Skip to content

Fix #277: return least-positive float for rationals close to it

When float-ratio-float is converting a rational to a float, if the rational is closer to least-positive float than 0, return the least-positive float.

This is done by checking if the "scale" factor is the least positive exponent. If so, multiply the fraction by 2 before scaling so that we get the least positive value. If we don't, then scaling always returns 0. (The fraction is always between 0.5 and 1.)

Merge request reports