rationalize
(rationalize number)
Returns the simplest rational that approximates a float within half a ulp on either side, so floating the answer reproduces the input. Integers and ratios are already exact, so they are returned unchanged.
(rationalize number)
Returns the simplest rational that approximates a float within half a ulp on either side, so floating the answer reproduces the input. Integers and ratios are already exact, so they are returned unchanged.