v0.1A scripting language for the web
Standard Library

math

Numeric helpers, trig functions, and a random number generator.

Import:

import "math";

Rounding

ceil(3.2)  | print; // 4
floor(3.8) | print; // 3
round(3.5) | print; // 4
abs(-7)    | print; // 7

Powers and roots

pow(2, 10) | print; // 1024
sqrt(81)   | print; // 9

Min / max

min(3, 7)  | print; // 3
max(3, 7)  | print; // 7

Logarithms

log is natural log; log2n is base-2; nlog is base-n.

log(2.71828) | print;
log2n(8)     | print;
nlog(100, 10) | print;

Trigonometry

Standard trig and hyperbolic functions are all available:

sin(x)   cos(x)   tan(x)
asin(x)  acos(x)  atan(x)
sinh(x)  cosh(x)  tanh(x)
asinh(x) acosh(x) atanh(x)

random

Return a random number.

random() | print;