slowly fixing bugs and writing a math library

This commit is contained in:
SpookyDervish
2025-10-19 10:32:33 +11:00
parent 4bd698e330
commit 4370dc4407
5 changed files with 154 additions and 79 deletions

View File

@@ -0,0 +1,19 @@
pi = Func(): Float {
return 3.141592653589793;
}
e = Func(): Float {
return 2.718281828459045;
}
rad = Func(degrees: Float): Float {
return degrees * $pi() / 180;
}
deg = Func(radians: Float): Float {
return 180 * radians / $pi();
}
sqrt = Func(n: Float): Float {
return $pow(n, 0.5);
}

View File

@@ -1,4 +1,7 @@
depend "tests/math.pla";
main = Func(): Int {
$print("%f\n", $sqrt(9.0));
$print("%f\n", $sqrt(100.0));
return 0;
}
}