Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

701 B
Raw Blame
// Integers and floats are one numeric domain for equality and membership: `1 == 1.0`.
// Operands are `let`-bound so the compiler emits the Eq/Float opcodes instead of folding.
let one := 1
let oneFloat := 1.0
let thousand := 1000
let thousandFloat := 1000.0
let floatString := '1.0'

print(one == oneFloat) // true
print(one != oneFloat) // false
print(2 == oneFloat) // false
print(thousand == thousandFloat) // true
print(true == oneFloat) // true
print(one == floatString) // true
print('1' == oneFloat) // true
print(oneFloat in [1, 2]) // true
print(has([1, 2], oneFloat)) // true
print(indexOf([1.0, 2.0], 2)) // 2
print(equals(one, oneFloat)) // true
print(notEquals(one, oneFloat)) // false