diff --git a/includes/std/math.pat b/includes/std/math.pat index fd14eeb..9cbf5e0 100644 --- a/includes/std/math.pat +++ b/includes/std/math.pat @@ -3,20 +3,33 @@ namespace std::math { fn min(auto a, auto b) { - return a < b ? a : b; + if (a < b) + return a; + else + return b; }; fn max(auto a, auto b) { - return a > b ? a : b; + if (a > b) + return a; + else + return b; }; fn clamp(auto x, auto min, auto max) { - return (x < min) ? min : ((x > max) ? max : x); + if (x < min) + return min; + else if (x > max) + return max; + else + return x; }; fn abs(auto x) { - if (x < 0) return -x; - else return x; + if (x < 0) + return -x; + else + return x; }; fn sign(auto x) { @@ -93,4 +106,4 @@ namespace std::math { fn acosh(auto value) { return builtin::std::math::acosh(value); }; fn atanh(auto value) { return builtin::std::math::atanh(value); }; -} \ No newline at end of file +}