Skip to content

liftFixnumInteger() should produce canonical rational #1816

@ds26gte

Description

@ds26gte

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!)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions