in reply to (jeffa) Re: Simple calculator
in thread Simple calculator

This was never intended to be used by anyone but me, but the snippets page dared me :)
Actually, in a bot called cu2q, I've got this really nice !calc function, but I still need to get it out of there and into a separate script. It's hundreds of lines, and based on this lil' snippet.
17:10 <Juerdje> !calc one thousand times the square root of threehundredandsixtytwo 17:10 <cu2q> 1000*sqrt 362 = 19026.2975904404 17:10 <Juerdje> !calc ~0 17:10 <cu2q> ~0 = 4294967295 17:10 <Juerdje> !calc -o:eng ~0 17:10 <cu2q> ~0 = fourmilliardtwohundredandninetyfourmillionninehundredandsixtyseventhou +sandtwohundredandninetyfive
When I'm done, I'll try to have it strict and with warnings. And when that's done (somewhere next year), I'll put it on perlmonks :)

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$

Replies are listed 'Best First'.
Re^3: Simple calculator
by Anonymous Monk on Nov 18, 2008 at 13:24 UTC
    wow, im searching for something similar for my bot. can i have it? pleease :)