What is it, 2**48-2 signaling NaNs and 2**48 quiet NaNs? Is my quick count
correct (in 64-bit)?  Great opportunity for steganography, I reckon.

On Sun, Dec 29, 2019 at 11:51 PM Tim Peters <tim.pet...@gmail.com> wrote:

> [David]
> > Has anyone actually ever used those available bits for the zillions of
> NaNs for
> > anything good?
>
> Yes:  in Python, many sample programs I've posted cleverly use NaN
> bits to hide ASCII encodings of delightful puns ;-)
>
> Seriously?  Not that I've seen.  The _intent_ was that, e.g., quiet
> NaNs could encode diagnostic information, such as the source code line
> number of the operation that produced a qNaN.  But I don't know that
> anyone ever exploited that.
>
> Signaling NaNs were even more quixotic.  For example, in theory, an
> implementation _could_ reserve some range of sNaN bit patterns to mean
> "the lower 20 bits are an index into a table of extended precision
> values", and a trap handler could catch the signal when the sNaN was
> used, and do extended-precision calculation in software, store the
> result in the table, and return an sNaN containing the result's index
> (or a regular double if the result fit in the format).
>
> In short, the kinds of things hardware designers think software would love
> ;-)
>


-- 
Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons.  Intellectual property is
to the 21st century what the slave trade was to the 16th.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/ZNTNYOMXWDXTVX7CLIUEUYEDDSDWW2VI/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to