That in itself is should make a few python gamers happy. Also some serious motivations for older version users, not all but more and more. Also many other interesting develepments others have highlighted already.
That in itself is should make a few python gamers happy. Also some serious motivations for older version users, not all but more and more. Also many other interesting develepments others have highlighted already.
Precision: 9 decimal digits
float:
result: 3.1415926535897927
time: 0.113188s
cdecimal:
result: 3.14159265
time: 0.158313s
decimal:
result: 3.14159265
time: 18.671457s
Precision: 19 decimal digits
float:
result: 3.1415926535897927
time: 0.112874s
cdecimal:
result: 3.141592653589793236
time: 0.348100s
decimal:
result: 3.141592653589793236
time: 43.241220sPi is 3.14159 26535 89793 238....
So I do wonder what rounding they are using, even truncating as I have (next digit 4 so good place to do that) then can see the last digit should at least be 8, worst case 7 and 6!! There again this may be a convention or result of the methord to calulate Pi.
As for floats, well, for accuracy I'd go with cdecimal right there, though is it as accurate. I suspect it is the formular used that induces the minute error in results.
http://en.wikipedia.org/wiki/Pi #21 reference
>>> pi()
Decimal('3.141592653589793238')
1. http://hg.python.org/cpython/file/344d67063c8f/Modules/_deci...