[Python-Dev] trunc()

Nick Coghlan ncoghlan at gmail.com
Sat Jan 26 06:09:27 CET 2008


Jeroen Ruigrok van der Werven wrote:
> Can I assume we are all familiar with the concept of significant digits and
> that we agree that from this point of view 2 != 2.0? And that results such as
> the above would be a regression and loss in precision?

Not really, because if someone cares about precision to that extent they 
won't be using binary floats anyway (they'll be using Decimal, or 
something like it). Besides, for trunc, ceil and floor, it's all zeroes 
after the decimal point by definition (no matter how many significant 
digits you started with).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-Dev mailing list