Comment 5 for bug 1488552

Revision history for this message
james anderson (james-anderson-0) wrote :

yes, i have read that.

10/1 is such a thing.
that is the source of the issue.

there are some use cases which dictate that an implementation distinguish between the integer "10" and the ratio "10/1". i did not establish the requirement. i am just trying to fullfill it. and, to do so without reimplementing the rational datatype with a double-boxed representation. more or less a sensible thing to do. until one observes that (ceiling 49/1) turns out to be 50.

if you are adamant, that the implementation cannot permit 0/x, this is fine, but then one would expect truncate to return a second value which the other math operators would recognize.
it did not.
for values such as "10/1" it returns "0/1" as the remainder.

would a more suitable patch cause truncate to return a second value which the remainder of the math operator implementation see as "zero", as it is?