Files
wren/test/core/number/is_infinity.wren
T
Bob Nystrom af90291f6f feat: add isInfinity and isInteger methods to Num class
Implements two new methods on the Num class: isInfinity checks if a number is positive or negative infinity using isinf(), and isInteger checks if a number has no fractional component, returning false for NaN and infinity. Includes C primitives, documentation, and test files.
2015-09-30 15:41:43 +00:00

4 lines
144 B
Plaintext

System.print(123.isInfinity) // expect: false
System.print((1/0).isInfinity) // expect: true
System.print((-10/0).isInfinity) // expect: true