iNum is an expression-based calculator language that makes mathematical calculations and unit conversions easy and intuitive.
- Integer (Natural):
42
,-17
- Float (Real):
3.14
,-0.001
- String:
"Hello"
,'World'
- Boolean:
true
,false
- Unit Value:
5km
,3.14m
,1024kb
x = 42
name = "iNum"
distance = 5km
- Addition:
+
- Subtraction:
-
- Multiplication:
*
- Division:
/
- Equal:
==
- Not Equal:
!=
- Greater Than:
>
- Greater or Equal:
>=
- Less Than:
<
- Less or Equal:
<=
x > 10 ? "big" : "small"
score >= 80 ? "pass" : score >= 60 ? "retry" : "fail"
fn double(x) = x * 2
fn circleArea(r) = pi * r * r
fn calculateTax(amount) = amount > 1000000 ? amount * 0.4 : amount * 0.2
5km to m // 5000
1gb to mb // 1024
(2km + 3km) to m // 5000
b64Encode(str)
: Encode string to Base64b64Decode(str)
: Decode Base64 stringtype(value)
: Get type of valuesin(x)
: Sine functioncos(x)
: Cosine function
pi
: Pi (3.141592...)e
: Euler's number (2.718281...)