You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Integer.pow with a negative exponent uses integer division (2.pow(-1) == 0) #706
Integer.pow with a negative exponent (src/stdlib/number.kex ~l.200) returns 1 / this.pow(0 - exponent), which is integer division:
2.pow(-1) == 0, 10.pow(-2) == 0
1.pow(-n) == 1, (-1).pow(-n) == ±1
0.pow(-1) raises division by zero
Is this intended? Alternatives: reject negative exponents with a domain error, or return a Float/Rational for them. Whatever the choice, document it and pin it with a spec.
Unrelated cleanup noticed nearby: Time.floorDiv (src/stdlib/time.kex ~l.515, used in date_time.kex and time.kex) reimplements Integer.div (floored quotient). Replace it with .div if the semantics match.
Activity
Time: floor-divide with Integer.div instead of a copy of it