Phase 8: Std::Math module + comprehensive feature showcase demo

This commit is contained in:
2026-05-31 13:51:59 +03:00
parent f6f122b4e4
commit 42ebee9fc0
2 changed files with 56 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
module Std::Math {
extern func bux_sqrt(x: float64) -> float64;
extern func bux_pow(x: float64, y: float64) -> float64;
extern func bux_abs_i64(x: int64) -> int64;
extern func bux_abs_f64(x: float64) -> float64;
extern func bux_min_i64(a: int64, b: int64) -> int64;
extern func bux_max_i64(a: int64, b: int64) -> int64;
extern func bux_min_f64(a: float64, b: float64) -> float64;
extern func bux_max_f64(a: float64, b: float64) -> float64;
func Sqrt(x: float64) -> float64 {
return bux_sqrt(x);
}
func Pow(x: float64, y: float64) -> float64 {
return bux_pow(x, y);
}
func Abs(n: int64) -> int64 {
return bux_abs_i64(n);
}
func AbsF(f: float64) -> float64 {
return bux_abs_f64(f);
}
func Min(a: int64, b: int64) -> int64 {
return bux_min_i64(a, b);
}
func Max(a: int64, b: int64) -> int64 {
return bux_max_i64(a, b);
}
func MinF(a: float64, b: float64) -> float64 {
return bux_min_f64(a, b);
}
func MaxF(a: float64, b: float64) -> float64 {
return bux_max_f64(a, b);
}
}