Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Using the gnu debugger as a high-precision calculator' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Using the gnu debugger as a high-precision calculator
Authored by: geohar on Oct 22, '04 11:25:49AM

Ah interesting. But what's wrong with bc?

>man bc
NAME
bc - An arbitrary precision calculator language
.....


;)



[ Reply to This | # ]
Using the gnu debugger as a high-precision calculator
Authored by: rwmitchell on Oct 22, '04 11:58:40AM

Or dc

NAME
dc - an arbitrary precision calculator


DESCRIPTION
Dc is a reverse-polish desk calculator which supports unlimited preci-
sion arithmetic. It also allows you to define and call macros.

And it uses reverse-polish notation to boot! Beats the heck out of that other way of doing math.



[ Reply to This | # ]
high-precision!
Authored by: rhowell on Oct 22, '04 01:30:03PM
Doh! I wish I knew about "bc" when Google put up its billboard ad.

>bc -l

>>scale=1000
>>e(1)

>>2.718281828459045235360287471352662497757247093699959574966967627724
07663035354759457138217852516642742746639193200305992181741359662904
35729003342952605956307381323286279434907632338298807531952510190115
73834187930702154089149934884167509244761460668082264800168477411853
74234544243710753907774499206955170276183860626133138458300075204493
38265602976067371132007093287091274437470472306969772093101416928368
19025515108657463772111252389784425056953696770785449969967946864454
90598793163688923009879312773617821542499922957635148220826989519366
80331825288693984964651058209392398294887933203625094431173012381970
68416140397019837679320683282376464804295311802328782509819455815301
75671736133206981125099618188159304169035159888851934580727386673858
94228792284998920868058257492796104841984443634632449684875602336248
27041978623209002160990235304369941849146314093431738143640546253152
09618369088870701676839642437814059271456354906130310720851038375051
01157477041718986106873969655212671546889570350354

[ Reply to This | # ]
high-precision!
Authored by: aranor on Oct 22, '04 06:33:49PM

Oh, yeah, that would have been useful. I ended up using Mathematica to calculate e to the appropriate number of places and then wrote a python script to solve the problem (later I re-wrote the python script in Mathematica itself)



[ Reply to This | # ]
high-precision!
Authored by: geohar on Oct 23, '04 04:24:52AM

I ended up kicking mathkernel invokations to do primality testing. ;) Perl script to hang it all together...



[ Reply to This | # ]