[gambit-list] Going through simple math
Marc Feeley
feeley at iro.umontreal.ca
Thu Apr 1 20:30:39 EDT 2010
On 2010-04-01, at 7:59 PM, Robert H wrote:
>> (- 1.5 1/2)
> 1.
>> (* 3 1/2)
> 3/2
>> (/ 1.5 3/4)
> 2.
>>
>
> Is there a reason that Gambit is dropping the trailing zero on those?
> Just "because"?
Why print more digits than necessary? All of these external representations are equal
2.
2.0
2.00
2.000
so why not choose the shortest one?
If you want to switch to the syntax with the single trailing zero (which is what Chez Scheme uses) then you can modify lib/_num.scm so that the line
(##define-macro (macro-chez-fp-syntax) #f)
now reads
(##define-macro (macro-chez-fp-syntax) #t)
Then do a "make".
Marc
More information about the Gambit-list
mailing list