[gambit-list] Test 5 failed

Bradley Lucier lucier at math.purdue.edu
Fri Oct 21 17:25:19 EDT 2011


On Thu, 2011-10-20 at 19:40 -0400, Marc Feeley wrote:

> 
> On 2011-10-20, at 5:54 PM, Bradley Lucier wrote:
> 
> > 
> > On Oct 20, 2011, at 3:42 PM, Marc Feeley wrote:
> > 
> >> On 2011-10-20, at 3:39 PM, Bradley Lucier wrote:
> >> 
> >>> Perhaps +nan.0 (and perhaps other system-dependent constants) should always be computed at load time for the module.
> >> 
> >> Perhaps, but how do you recreate the NaN that was compiled?
> > 
> > But why would you want to?
> 
> So that gsc is a function of one argument: from Scheme source code to C source code, i.e.
> 
>     Scheme_source -> C_source
> 
> instead of
> 
>     Scheme_source * platform -> C_source
> 
> >  On one machine, it might be a signaling NaN, on another, it might be silent.
> 
> But there is just one +nan.0 available in Scheme source code.


There is only one lexical symbol "+nan.0" in (Gambit) scheme code.  In
my opinion it should represent a generic NaN on the machine where the
code is running.  At load time a NaN can be boxed up and bound to
+nan.0.


>   We are talking about the representation of this NaN, not all possible NaNs.


I don't know what you mean "this NaN".  On output, this symbol is used
for any NaN that is given to display.  There is no "this NaN".

Some on the R7RS committee have said explicitly that they think that
there is "one NaN", and then this leads to problems.  As  you say, gsc
shouldn't use the bit representation of a specific NaN on the machine
where gsc is running.  But if you fix a bit pattern for the NaN
generated by gsc, then that NaN may be interpreted differently when the
code is running on different machines.  (It may be signalling on one
machine, and non-signalling on another.)

Anyway, it's not that important.  Your solution has the great benefit of
not having people worry about test failures that are not that important.

I've argued before (to little avail) that the notation for NaNs in
scheme should allow the programmer to specify the sign and the (nonzero)
mantissa of a NaN, and that those quantities should be displayed by
"display".

Brad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20111021/9eb92b05/attachment.htm>


More information about the Gambit-list mailing list