[racket] ~r: formatting 0.0 with 'exponential and #:precision

From: Dmitry Pavlov (dpavlov at ipa.nw.ru)
Date: Tue May 7 13:12:11 EDT 2013

Hello,

I just came across the following oddness with formatting
of real numbers:

 > (~r 1.0 #:notation 'exponential #:precision '(= 4))
"1.0000e+00"

OK


 > (~r 0.0 #:notation 'exponential #:precision '(= 4))
"0.e+04"

???

Is there a rational explanation of why did
the requested precision go into the exponent
number for 0.0?

Thanks.


Best regards,

Dmitry

Posted on the users mailing list.