pyret-lang
pyret-lang copied to clipboard
liftFixnumInteger() should produce canonical rational
When lifting a fixnum n to be a Rational boxnum, liftFixnumInteger() does the lazy thing by simply creating a Rational with numerator = n and denominator = 1. (I.e., n need not be an integer!)
This works sometimes but fails when using _integerMultiply on the numerator and denominator, as happens when doing lessThanOrEqual(). _integerMultiply will not work correctly if either of its arguments is non-integer.
I'll be incorporating a fix when adding the upcoming JS nums test suite. (Found the error while writing the test suite!)
@ds26gte is this already covered by #1818 ?