ottobrown/calculator

A simple floating-point command line calculator

Input to the calculator can be entered as command line arguments. If no arguments are entered, the calculator will enter a repl mode.

Examples

2 + 2
         4
(1 + sqrt3)/2
         1.3660254037844386
sin(90 degrees)
         1
pi^2/6
         1.6449340668482264
(3.5*10^-4)(6.2*10^2)
         0.217

Operartors

  • + (addition)
  • - (subtraction)
  • - (negative)
  • * (multiplication)
  • / (division)
  • ^ (exponentiation)

Constants

  • pi = 3.141592653589793
  • e = 2.718281828459045
  • degrees or deg = pi/180

Functions

  • ln
  • sin, cos, tan
  • asin, acos, atan
  • sqrt, cbrt