[r6rs-discuss] [Formal] Formal Comment: NaN should be considered a number, not a real

Alan Watson alan at alan-watson.org
Sat Jun 30 20:05:00 EDT 2007


Aubrey Jaffer wrote:
> SCM's addition routine codes no tests for NaNs.  Neither do any of
> SCM's other arithmetic operations.  Because NaNs in flonums are
> contagious, checks for NaNs can be delayed until it is convenient for
> the implementation.  In SCM's case, this is in the routine which boxes
> inexact numbers.
> 
> [...]
> 
> Skipping the check for NaN and infinities improved the CPU-time (the
> "User" line in the data) less than 2%, while CPU-time variations were
> around 1%.  The raw readings are appended.

SCM is not a fast implementation of Scheme. Therefore, that something 
provokes a 2% change in the run-time of a program in SCM does not imply 
that it will provoke similarly small changes in other implementations.

Regards,

Alan



More information about the r6rs-discuss mailing list