[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] multiple NaN values
-----BEGIN PGP SIGNED MESSAGE-----
On 02/20/2012 04:16 PM, Per Bothner wrote:
> Note there could potentially be 2^52-1 different NaNs, so pre-allocating
> them is not an option. Even interning as needed adds overheads. Of
> course using all these NaNs is unlikely, but one can imagine using
> those bits for special purposes, and wanting Scheme to not drop the
> information in them.
In practice I believe systems are built on CPUs that produce no more
than one to seven different NaNs as results to mathematical
operations, so I don't think preallocating and interning the NaNs
that are actually possible on the local CPU would be that big a
problem in most implementations.
However, when implementing Scheme on a 64-bit CPU, it is "reasonable"
to use NaN bit patterns to indicate, eg, characters and integers.
In that case, however, eq? and eqv? will of course be implemented as
aware of that use.
I'm just saying, let's be careful not to overspecify and make "NaN
bit patterns according to IEEE754" have special semantics; the
bit patterns may be mapped to useful elements in some schemes. The
only ones a particular implementations needs to care about are the
ones that the local CPU can *produce* as NaN values (or the one
that's visible through the underlying virtual machine, in the case
of JVM schemes).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
Scheme-reports mailing list