[gambit-list] How emulate #e using inexact->exact or something?
feeley at iro.umontreal.ca
Tue Dec 24 14:17:38 EST 2013
On Dec 24, 2013, at 1:54 PM, Mikael <mikael.rcv at gmail.com> wrote:
> Ah - http://www.binaryconvert.com/result_double.html?decimal=048046051 clarifies that
> 0.3 is represented internally as 2.99999999999999988897769753748E-1 ,
> so this is what inexact->exact converts to 5404319552844595/18014398509481984 .
Hmmm… that’s not the exact decimal representation of the floating point 0.3. In Gambit, to know the exact decimal expansion of an inexact number you can use multiplication by a large power of 10:
> (* (expt 10 70) (inexact->exact 0.3))
More information about the Gambit-list