Dan Upton wrote:
....
Ramanujan?
On Thu, May 22, 2008 at 2:53 PM, Mensanator <mensanator@aol .comwrote:
>On May 22, 11:32 am, "Dutton, Sam" <Sam.Dut...@itn .co.ukwrote:
>If you actually need that many digits, use a different library.
>>
>3.141592653589 79323846
>3.141592653589 793238462643383 279502884197
>3.141592653589 793238462643383 279502884197169 399375105820974 94459
>>I've noticed that the value of math.pi -- just entering it at the interactive prompt -- is returned as 3.1415926535897 931, whereas (as every pi-obsessive knows) the value is 3.1415926535897 932... (Note the 2 at the end.)
>>>
>>Is this a precision issue, or from the underlying C, or something else? How is math.pi calculated?
>>>
>>Is this a precision issue, or from the underlying C, or something else? How is math.pi calculated?
>>
>>>>import gmpy
>>>>print gmpy.pi(64) # 64 bit precision
>>>>print gmpy.pi(64) # 64 bit precision
>>>>print gmpy.pi(128) # 128 bit precision
>>>>print gmpy.pi(16384) # 16384 bit precision
>
Who wants to verify that that's correct to that many digits? ;)
Who wants to verify that that's correct to that many digits? ;)
Ramanujan?
Comment