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


Click here to return to the 'Yet another command line calculator' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Yet another command line calculator
Authored by: boredzo on Feb 02, '05 11:45:52AM

a better way to do that fib function in version 2.3 or later of Python, instead of print, is the yield statement

yield b

(note that there is no comma at the end like there is at the end of the print statement in the print version.)

for my calculations, though, I use calc, by Landon Curt Noll. its syntax resembles C in many ways (the only major difference being the use of an xor() function instead of the ^ operator, which is reverted to exponentiation). its big advantage is that it is arbitrary precision, so it is always accurate - no roundoff error, and every number is supported. try 2 to the power of 128 in some other calculator sometime. ☺



[ Reply to This | # ]