example/std.math.primi
//
// Module "std.math"
//
//
// Functions.
//
import std.math
x = (456 * 789 * 123 / 2.3 ) + 111
assert(math.round(x, 6) == 19240733.608696)
a = (789 * (2 + 3)) * 1
b = 123 * 456 * 789 / 2.3 + 111
x = a + b
assert(math.round(x, 6) == 19244678.608696)
x = b + a
assert(math.round(x, 6) == 19244678.608696)
x = math.round(b + a) * 123
assert(x == 2367095517)
x = math.round(a + b) * 123 * 999123
assert(x == 2365019574231591)
x = math.sqrt(9)
assert(x == 3)
x = math.pow(3)
assert(x == 9)
x = math.pow(3, 2)
assert(x == 9)
x = math.pow(3, 4)
assert(x == 81)
x = math.pow(3, 400)
assert(x == 70550791086553325712464271575934796216507949612787315762871223209262085551582934156579298529447134158154952334825355911866929793071824566694145084454535257027960285323760313192443283334088001)
x = math.cos(0)
assert(x == 1)
x = math.sin(0)
assert(x == 0)
x = math.ceil(1.3)
assert(x == 2)
x = math.floor(1.8)
assert(x == 1)
x = math.round(1.6)
assert(x == 2)
x = math.round(1.5)
assert(x == 2)
x = math.round(1.49)
assert(x == 1)
//
// Some mathematical constants.
//
assert(math.PI == 3.14159265358979323846, 'Good old number π')
assert(math.E == 2.718281828459045, 'Euler number')