This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Fast, flexible, calculating from the command line

Posted by: Anonymous [ip: 81.241.251.49] on March 13, 2008 01:18 PM
My ultimate calc is irb ( interactive ruby) with auto-completion
* fully scriptable (it's ruby)
* simple syntax for math
* auto-completion
* readline support good for history navigation

# irb$ irb
irb(main):001:0> include Math
=> Object
irb(main):002:0> 2 ** 5
=> 32
irb(main):003:0> 111 /10
=> 11
irb(main):004:0> 111 /10.0
=> 11.1
irb(main):005:0> sin(0.5)
=> 0.479425538604203
irb(main):007:0> def f(x) sin(x) * cos(x) end
=> nil
irb(main):008:0> f 0.6
=> 0.466019542983613
irb(main):009:0> f(0.6)
=> 0.466019542983613

#

Return to Fast, flexible, calculating from the command line