[David]
> What is it, 2**48-2 signaling NaNs and 2**48 quiet NaNs? Is my quick count
> correct (in 64-bit)?

Any bit pattern where the exponent is all ones (there are 11 exponent
bits, giving 2**(64-11) = 2**53 bit patterns with an all-ones
exponent), _and_ the significand isn't all 0 (it's an infinity if
they're all 0).  So that's 2**53 - 2 NaN bit patterns in all.  The
original standard didn't define the encoding difference between
signaling and quiet, so all that can be said is that there are 2**52 -
2 of one and 2**52 of the other.  But in real life, almost all
implementations take the most-significant bit of the significand to
mean "quiet", so in almost all implementations there are 2 more qNaNs
than sNaNs.

>  Great opportunity for steganography, I reckon.

Too easy ;-)  When I send messages to my Russian handlers, I send a
long list of floating-point + - * / and sqrt examples.  The CIA hasn't
yet figured out the secret:  an example means "1" if the 56th most
significant bit of the infinitely precise result is 1, else 0.
Staring at the actual double precision results is useless :-)
_______________________________________________
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/DAZGFKPERMUCA36II3VLRAXO7LHYFMYJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to