[BangPypers] A link I found today

Noufal Ibrahim noufal at gmail.com
Mon Oct 12 12:32:55 CEST 2009


On Mon, Oct 12, 2009 at 3:47 PM, Anand Chitipothu <anandology at gmail.com> wrote:
[..]
> It looks like number of decimal digits printed are 17 in Python, 16 in
> Haskell and 15 in Ruby.
>
> Is there any way to change that behavior in Python?
[..]

I guess it would be from the __repr__ from the int object? That's
implemented in C isn't it?

Apropos the floating point issue, check out
http://cobra-language.com/docs/python/ (the Accurate Math section)

> The problem is that Python defaults to a binary floating point type even though most numbers that people input are base 10. To help
> address this Python offers an additional Decimal type that computes the correct numbers, but it must be used explicitly and, some
> would say, awkwardly:

-- 
~noufal
http://nibrahim.net.in


More information about the BangPypers mailing list