Files
wren/test/number/minus.wren
T
Bob Nystrom 193e4e30ab feat: add ceil, cos, sin, sqrt, isNan native methods and division-by-zero tests
Implement five new Num methods (ceil, cos, sin, sqrt, isNan) in wren_core.c and register them on the Num class. Add corresponding test files for ceil, floor, is_nan, and sqrt. Extend divide.wren with division-by-zero edge cases (inf, -inf, nan). Remove stale TODO comments from minus, multiply, and plus tests.
2014-01-08 15:47:14 +00:00

9 lines
172 B
Plaintext

// Infix.
IO.print(5 - 3) // expect: 2
IO.print(3.1 - 0.24) // expect: 2.86
IO.print(3 - 2 - 1) // expect: 0
// Unary negation.
var a = 3
IO.print(-a) // expect: -3