A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-October/069200.html below:

[Python-Dev] Caching float(0.0)

[Python-Dev] Caching float(0.0)"Martin v. Löwis" martin at v.loewis.de
Wed Oct 4 07:34:51 CEST 2006
Alastair Houghton schrieb:
> On 3 Oct 2006, at 17:47, James Y Knight wrote:
> 
>> On Oct 3, 2006, at 8:30 AM, Martin v. Löwis wrote:
>>> As Michael Hudson observed, this is difficult to implement, though:
>>> You can't distinguish between -0.0 and +0.0 easily, yet you should.
>>
>> Of course you can. It's absolutely trivial. The only part that's even
>> *the least bit* sketchy in this is assuming that a double is 64 bits.
>> Practically speaking, that is true on all architectures I know of,
> 
> How about doing 1.0 / x, where x is the number you want to test?  

This is a bad idea. It may cause a trap, leading to program termination.

Regards,
Martin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4