Why does Python’s hash of infinity have the digits of π?
The hash of infinity in Python has digits matching pi: >>> inf = float(‘inf’) >>> hash(inf) 314159 >>> int(math.pi*1e5) 314159 Is that just a coincidence or is it intentional? 3 Answers 3
The hash of infinity in Python has digits matching pi: >>> inf = float(‘inf’) >>> hash(inf) 314159 >>> int(math.pi*1e5) 314159 Is that just a coincidence or is it intentional? 3 Answers 3
I’m looking for the fastest way to obtain the value of π, as a personal challenge. More specifically, I’m using ways that don’t involve using #define constants like M_PI, or hard-coding the number in. The program below tests the various ways I know of. The inline assembly version is, in theory, the fastest option, though … Read more
I was trying various methods to implement a program that gives the digits of pi sequentially. I tried the Taylor series method, but it proved to converge extremely slowly (when I compared my result with the online values after some time). Anyway, I am trying better algorithms. So, while writing the program I got stuck … Read more