[gambit-list] (* n 1.0) works as an exact->inexact for all integer n:s except for 0, is that intended?

Pierpaolo Bernardi olopierpa at gmail.com
Fri Mar 7 10:53:05 EST 2014


On Fri, Mar 7, 2014 at 4:11 PM, Mikael <mikael.rcv at gmail.com> wrote:
> Why this result of (haxor-exact->inexact 0), just curious, does the RNRS
> dictate this?

In addition to what Bradley wrote, returning exact 0 is more in the
spirit of scheme.

High quality implementations will return exact answer when possible.
Another example is the square root of an exact square: try (sqrt 4) in
various implementations, or (sin 0), or other special angles.

This behaviour is not mandated, to allow for implementations caring
more about sped than exactness.

Cheers
P.



More information about the Gambit-list mailing list