[gambit-list] How emulate #e using inexact->exact or something?
Mikael
mikael.rcv at gmail.com
Mon Dec 23 19:44:03 EST 2013
Dear Marc or Brad,
First - Happy Holidays! :))
A Q:
> #e0.3
3/10
> (inexact->exact 0.3)
5404319552844595/18014398509481984
> #e0.2
1/5
> (inexact->exact 0.2)
3602879701896397/18014398509481984
Why the different results? Is there any way to get the #e behavior in a
more effective way than (string-append "#e" (number->string n))?
The end goal here is to get decimal arithmetics with precision e.g. (float
(* (- 0.3 0.2) 10)) != 0.
Thanks,
Mikael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20131224/4efc5467/attachment.htm>
More information about the Gambit-list
mailing list