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

Mikael mikael.rcv at gmail.com
Fri Mar 7 14:22:53 EST 2014


Ah noted, nice point.


2014-03-07 16:53 GMT+01:00 Pierpaolo Bernardi <olopierpa at gmail.com>:

> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20140307/42db0696/attachment.htm>


More information about the Gambit-list mailing list