math.sleela.expected.txt
lib/ui/example/science/math.sleela.expected.txt · 33 line(s) · txt
================================================================
SLeeLa Science — Mathematics (import math;)
================================================================
[constants]
pi = 3.14159
e = 2.71828
tau = 6.28319 (2*pi)
[unary]
abs(-12.5) = 12.5
sqrt(144) = 12
exp(1) = 2.71828 (== e)
log(e) = 1
log10(1000) = 3
sin(pi/2) = 1
cos(0) = 1
tan(pi/4) = 1
floor(3.7) = 3
ceil(3.2) = 4
trunc(-3.7) = -3
sign(-9) = -1
[binary]
pow(2, 8) = 256
hypot(3, 4) = 5
min(42, 17) = 17
max(42, 17) = 42
fmod(10, 3) = 1
[ternary]
clamp(400, 50, 300) = 300
================================================================
Done
================================================================
Math is the base subject; physics / astrophysics / sociology all build on it.