[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] multiple NaN values



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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).

				Bear

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPQ2OPAAoJEAOzWkqOibfN+UEH+QE9Rw3iolCkEK2TyARDvUeg
soySaCzbvZjxa7upjKfolTtEIYLC5x7ZUXJQhGlLjn94lylJtrZBMGwwNIPgGI2Y
HmRMRw9NKzDCwSW/Zg7BQza74Bl1OcG1cc/TYNWe6nNmGodhdbzwUOnVddWIblkc
x9/bHN4ToOfLl8V/Qxq2gFzYZFXt09vqDmv+JVz7ZXWVFMezpmv7cgSnZjYjV1wA
6ziKKdvKQlIyoT8uDY+6IzR4BPqrVgySLS4f3YgfNeKo35LUM85P6JXdI5/O5rZ7
4elqs3NGcOqgs1ol+glGtjbBfRyjaJ9DHRo2tektQ5U175c+xcBYHkvBKB/qfMY=
=Kkb1
-----END PGP SIGNATURE-----

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports