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/2008-February/076892.html below:

[Python-Dev] New math functions

[Python-Dev] New math functions [Python-Dev] New math functionsMark Dickinson dickinsm at gmail.com
Fri Feb 15 14:27:05 CET 2008
On Tue, Feb 12, 2008 at 1:52 AM, Raymond Hettinger <python at rcn.com> wrote:

> Also, it would be useful to have a new method, float.is_integer().  This
> would be better than the current approach where we make the
> test:  if x == floor(x).
>

How common is this test?  Given the inexact nature of floating-point
arithmetic, checking whether a float is exactly an integer seems like
something that one might actually want to discourage, just like comparing
two floats for equality.

Also, what about having float.is_finite, as a quicker way to spell "not
isinf(x) and not isnan(x)"

+1 on making these methods of float;  they're fundamental properties.

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20080215/b1643f1d/attachment.htm 
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