Skip to content

A simple infix notation floating-point cli calculator

License

Notifications You must be signed in to change notification settings

camel-cdr/culator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Culator

A simple infix notation floating-point cli calculator supporting:

  • Simple operations: +, -, *, /, **/^
  • Grouping with parentheses: (, )
  • Math constants, e.g.: pi, e
  • Math functions, e.g.: sqrt, sin, atan2, trunc

Examples

$ culator
(3 + 2) / 3
1.66666666666667
3 + 2 / 3
3.66666666666667

2**32
4294967296

e
2.71828182845905
pi
3.14159265358979

sin(2*pi)
-1.73436202602476e-34
atan2(1, 1) * 180 / pi
45

e^(1/3 + 2)
10.3122585013258
$ # Calculate the average line width of FILE
$ culator "`wc -c README.md | cut -d " " -f1` / `wc -l README.md | cut -d " " -f1`"
29.1190476190476

Install

sudo make clean install

Licensing

MIT or public domain, see LICENSE.

References

  • Per Vognsen's Bitwise tutorial series [day 3]

About

A simple infix notation floating-point cli calculator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published