pyret-lang icon indicating copy to clipboard operation
pyret-lang copied to clipboard

liftFixnumInteger() should produce canonical rational

Open ds26gte opened this issue 3 months ago • 2 comments

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 avatar Sep 19 '25 05:09 ds26gte

@ds26gte is this already covered by #1818 ?

schanzer avatar Oct 10 '25 16:10 schanzer

@ds26gte is this already covered by #1818 ?

Yes.

ds26gte avatar Oct 10 '25 20:10 ds26gte