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-January/076491.html below:

[Python-Dev] trunc()

[Python-Dev] trunc()Facundo Batista facundobatista at gmail.com
Fri Jan 25 18:45:06 CET 2008
2008/1/25, Jeffrey Yasskin <jyasskin at gmail.com>:

> decision comes to be that int(float) should be blessed as a correct
> way to truncate a float, I'd agree with Raymond that trunc() is just
> duplication and should be eliminated. I'd, of course, rather have a
> spelling that says what it means. :)

Mmm... no. int() is a builtin way to transform the builtin data type
float into the builtin data type float.

There's no "correct" way for a float to become an integer, but in the
math module you have several ways to do it (floor, ceil, round, trunc,
choose the one that you want, but you're "notified" <wink/2> that
there're different ways to do it).

-- 
.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
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