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

[Python-Dev] trunc()

[Python-Dev] trunc() [Python-Dev] trunc()Greg Ewing greg.ewing at canterbury.ac.nz
Mon Jan 28 07:10:13 CET 2008
> On Jan 25, 2008 11:21 PM, Raymond Hettinger <python at rcn.com> wrote:
> 
>>...  int() for making ints from the non-fractional
>>portion of a float.

To me, the concept of the "integer part of a float" isn't all that
well defined. It's really a property of a particular representation
rather than the number itself. You think of it as a string of digits
and chop off the part after the point, then turn what's left back
into a number.

If negative floats were represented in two's complement, for
example, then chopping off the digits after the point would give
a result more like floor than trunc.

--
Greg

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