3 ms·
Here's an example if you want to try http://www.benzedrine.ch/pi-spigot.c http://www.benzedrine.ch/pi-spigot.c
by dhartmei 8y ago
Here's an example if you want to try http://www.benzedrine.ch/pi-spigot.c http://www.benzedrine.ch/pi-spigot.c
- leni536 8y agoThis doesn't look like a spigot algorithm. It has a link in the comments[1], it calculates the digits of PI from the beginning. The code you linked seems to implement the exact same algorithm. I don't fully comprehend the code still, but the SCALE parameter suggest that it handles the elements of the array as a fixed point representation of real numbers. I wonder if it's correct for large number of digits. [1] http://www.codecodex.com/wiki/Calculate_digits_of_pi#C http://www.codecodex.com/wiki/Calculate_digits_of_pi#C