This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TurtleHunter's profile picture

Pi calculator V2 Infinite decimals!

Started by TurtleHunter, 16 March 2014 - 01:10 PM
TurtleHunter #1
Posted 16 March 2014 - 02:10 PM
I made a program when I was bored to calculate pi. One of the problems of it was it didnt have support for infinite decimals, so i took over it and remaded it based on http://rosettacode.org/wiki/Pi#Lua, also is nicer :P/>. If you cant see the entire screen for reading the number, it saves it to a file called piresult with the real time and date when it was created, if that timeout, it prints time and date of your minecraft world

pastebin get aBGkfgxd picalc

Edit: fixed derp

Screenshots
when you open the program


Calculating



Finished(ask you to run again from where it finished)
Edited on 16 June 2014 - 08:56 PM
Tjakka5 #2
Posted 16 March 2014 - 04:13 PM
Gah, why didnt you post this 2 days ago?!
It was Pi day then!
TurtleHunter #3
Posted 16 March 2014 - 05:09 PM
I know! I couldnt, but the idea was there so i posted it
oeed #4
Posted 16 March 2014 - 09:04 PM
Looks good. Could you increase the number of decimal places though?
TurtleHunter #5
Posted 16 March 2014 - 11:50 PM
Looks good. Could you increase the number of decimal places though?
Thats on the TODO, but i dont find a bigInt api that supports negative values
Konlab #6
Posted 03 April 2014 - 02:51 PM
Useless.
Write in your program:
pinum = math.pi()
print(pinum)

And done, you have and done,
But if you incerase the decimal places,
Congratulation!
TurtleHunter #7
Posted 16 June 2014 - 01:17 AM
New version! now with infinite decimals!
TurtleHunter #8
Posted 16 June 2014 - 10:56 PM
Added screenshots and fixed a bug