maid-lang 1.1.0

Maid Programming Language
Documentation
# file math.maid: math functions and objects

obj math_pi = 3.141592653589793;
obj math_e = 2.718281828459045;

func math_radians(degrees) {
    give degrees * (math_pi / 180.0);
}

func math_degrees(radians) {
    give radians * (180.0 / math_pi);
}

func math_abs(x) {
    if x >= 0 {
        give x;
    } otherwise {
        give -x;
    };
}

func math_sqrt(x) {
    if x < 0 {
        uhoh("cannot compute square root of negative number");
    }

    give x ^ 0.5;
}