How is that fancy bitmask version different from my 3-line version? On Sun, Dec 29, 2019, 11:01 PM Tim Peters <tim.pet...@gmail.com> wrote:
> [Richard Damon <rich...@damon-family.org>] > > IEEE total_order puts NaN as bigger than infinity, and -NaN as less than > > -inf. > > > > One simple way to implement it is to convert the representaton to a 64 > > bit signed integer (not its value, but its representation) and if the > > sign bit is set, complement the bottom 63 bits (because floats are > > signed-magnitude). For pure python code, I don't know how hard it is to > > get the representation of a float as a 64 bit integer. In C or Assembly > > it is fairly easy as you can easily get around the type system, but I > > don't know python well enough to do it. > > There's a Python implementation here: > > https://bugs.python.org/msg336487 > _______________________________________________ > 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/HGCIHFU3ZLK3YLLK6A7GKFPUIRRITXQV/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ 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/7TRKC3YIX3DHFLOAHBNQJLFG56DQX5OI/ Code of Conduct: http://python.org/psf/codeofconduct/