sci-calc-pro
v1.0.0
Published
Professional scientific calculator CLI for Node.js
Maintainers
Readme
sci-calc-pro
Professional scientific calculator CLI for Node.js. Zero dependencies, pure JavaScript.
Install
npm install -g sci-calc-proOr use directly in a project:
npx sci-calc-pro "sin(45)"Usage
One-liner
sci-calc "2^10"
sci-calc "sin(45) + cos(60)"
sci-calc "sqrt(144)"
sci-calc "fact(10)"
sci-calc "log(1000)"
sci-calc "C(10,3)"Interactive REPL
sci-calc --repl
sci-calcsci> 2 + 3
= 5
sci> sin(45)
= 0.707106781187
sci> set x = 10
sci> x^2
= 100
sci> help
sci> exitFunctions
| Category | Functions |
| -------------- | --------------------------------------------------- |
| Basic | sqrt, cbrt, abs, pow, mod |
| Trigonometric | sin, cos, tan, asin, acos, atan, atan2 |
| Hyperbolic | sinh, cosh, tanh, asinh, acosh, atanh |
| Logarithmic | log (base 10), ln (natural), log2, exp, exp2, exp10 |
| Combinatorics | fact/factorial, perm/P, comb/C |
| Rounding | round, floor, ceil, trunc |
| Aggregation | max, min |
Constants
pi- 3.14159265358979...e- 2.71828182845904...phi- Golden ratio (1.61803398874989...)
REPL Commands
| Command | Description |
| ----------------- | ------------------------------ |
| help | Show help |
| list | List all functions |
| vars | Show stored variables |
| set x = expr | Store a variable |
| history | Show calculation history |
| unit deg/rad | Set angle unit |
| ms expr | Store to memory |
| mr | Recall memory |
| mc | Clear memory |
| clear | Clear screen |
| exit | Quit |
Flags
sci-calc <expression> Evaluate expression
sci-calc --repl Start interactive mode
sci-calc --help Show help
sci-calc --version Show version
sci-calc --list List functions
sci-calc --unit <deg|rad> Set angle unit for evaluationExamples
# Trig in degrees
sci-calc "sin(30)"
sci-calc "atan2(1,1)"
# Factorials and combinations
sci-calc "fact(20)"
sci-calc "C(52,5)" # 5-card poker hands
# Complex expressions
sci-calc "sqrt(e^2 + pi^2)"
sci-calc "log(1000) + ln(e^5)"
# Powers and roots
sci-calc "2^128"
sci-calc "cbrt(27)"
# With angle unit
sci-calc --unit rad "sin(1.5708)"License
MIT
