|
SofaCalc 1.0 - Coded by Louthrax
Usage:
SCALC [EXPR | /option]...
Notes:
- Expressions and options can appear in ANY order.
- Options affect only the expressions that FOLLOW them.
- Multiple expressions are evaluated sequentially.
- All options are prefixed with '/'.
Expression syntax:
Arithmetic operators (C-like precedence):
+ - * / ! ^ **
Logical / bitwise functions:
and(x,y) or(x,y) xor(x,y) neg(x)
Functions:
sin(x) cos(x) tan(x) atan(x)
ln(x) log(x,y) exp(x) sqrt(x)
floor(x) abs(x)
real(x) imag(x)
Constants:
pi e i
Numeric literals:
Decimal : 12.34 1e-3
Binary : 0b1011 0b1.01
Hex : 0xFF 0xA.B
Units (input):
Length : mm cm m km ly
Mass : g kg
Time : s min h y
Angle : rad deg
Display options:
/mm /cm /m /km /ly
/g /kg
/s /min /h /y
/rad /deg
Numeric display base:
/0b binary
/0x hexadecimal
(default: decimal)
Other options:
/tree display evaluation tree
Examples:
SCALC 100cm*100cm -> 1m^2
SCALC 300m/s /km /h -> 1079.9999km/h
SCALC (3+2*i)-(6+5*i) -> -3 - 3i
SCALC e^(i*pi) -> -1 + (1.5*10^-7)i
SCALC /0b 0xFF AND 0b1010 -> 0b1010
SCALC 1/2*9.81m/s^2*3s^2 -> 44.145m
SCALC /0b 65537 /0x 65537 -> 0b10000000000000001 0x10001
SCALC 0b1.1 -> 1.5
SCALC /0b xor(0x0F0F0F,0b101010101010101010101010) -> 0b101001011010010110100101
|