[gambit-list] Any rational-number->string with infinite precision for decimal output? (i.e. d.ddddd rather than x/y)
Mikael
mikael.rcv at gmail.com
Wed Jan 15 12:44:26 EST 2014
Dear Brad or Marc and list,
Curious, so you can parse into Gambit a decimal number with infinite
precision, with exactness, by just appending "#e" to it i.e. > (define
(string->exact-number s) (string->number (string-append "#e" s)))
> (string->exact-number "1.23478289348923749872394728934")
61739144674461874936197364467/50000000000000000000000000000
Is there any way to do the opposite? All I see number->string give is
"61739144674461874936197364467/50000000000000000000000000000"
- how would the definition of an exact-number->string look that produced an
output with decimals,
i.e. something that gave "1.23478289348923749872394728934" or
"#e1.23478289348923749872394728934" back?
I understand there are cases with unlimited number of decimals i.e. 1/3, a
typechecker for that would be awesome.
Thanks,
Mikael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20140115/1ec72571/attachment.htm>
More information about the Gambit-list
mailing list