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

Bakul Shah bakul at bitblocks.com
Fri Mar 7 13:01:51 EST 2014


On Fri, 07 Mar 2014 10:54:58 EST Bradley Lucier <lucier at math.purdue.edu> wrote:
> On 03/07/2014 10:53 AM, Pierpaolo Bernardi wrote:
> >
> > 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.
> 
> Try (sqrt +2i) or (expt -1 1/3) in Gambit ;-).

Shouldn't it return all the roots? :-)

Been meaning to ask:

> (expt +nan.0 0)
1
> (expt 1 +nan.0)
+nan.0	

This seems to be at least inconsistent. Seems to me both
should return 1

> (expt nan 0.0)
+nan.0
> (expt 1.0 nan)
+nan.0

These seem fine.

But I am not a mathematician.



More information about the Gambit-list mailing list