A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-July/054993.html below:

[Python-Dev] math.fabs redundant?

[Python-Dev] math.fabs redundant? [Python-Dev] math.fabs redundant?Tim Peters tim.peters at gmail.com
Fri Jul 29 17:57:06 CEST 2005
[Skip]
> Why does math have an fabs function?  Both it and the abs builtin function
> wind up calling fabs() for floats.  abs() is faster to boot.

Nothing deep -- the math module supplies everything in C89's standard
libm (+ a few extensions), fabs() is a std C89 libm function.

There isn't a clear (to me) reason why one would be faster than the
other; sounds accidental; math.fabs() could certainly be made faster
(as currently implemented (via math_1), it endures a pile of
general-purpose "try to guess whether libm should have set errno"
boilerplate that's wasted (there are no domain or range errors
possible for fabs())).
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