aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/nums.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdlib/nums.h')
-rw-r--r--src/stdlib/nums.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/stdlib/nums.h b/src/stdlib/nums.h
index 84d87dd5..5871c904 100644
--- a/src/stdlib/nums.h
+++ b/src/stdlib/nums.h
@@ -32,12 +32,8 @@ CONSTFUNC bool Num$isnan(double n);
double Num$nan(Text_t tag);
CONSTFUNC double Num$mix(double amount, double x, double y);
OptionalNum_t Num$parse(Text_t text);
-MACROLIKE CONSTFUNC bool Num$is_between(const double x, const double low, const double high) {
- return low <= x && x <= high;
-}
-MACROLIKE CONSTFUNC double Num$clamped(double x, double low, double high) {
- return (x <= low) ? low : (x >= high ? high : x);
-}
+CONSTFUNC bool Num$is_between(const double x, const double low, const double high);
+CONSTFUNC double Num$clamped(double x, double low, double high);
MACROLIKE CONSTFUNC double Num$from_num32(Num32_t n) { return (double)n; }
#ifdef __GNUC__
#pragma GCC diagnostic push
@@ -91,12 +87,8 @@ CONSTFUNC bool Num32$isnan(float n);
CONSTFUNC float Num32$mix(float amount, float x, float y);
OptionalNum32_t Num32$parse(Text_t text);
float Num32$nan(Text_t tag);
-MACROLIKE CONSTFUNC bool Num32$is_between(const float x, const float low, const float high) {
- return low <= x && x <= high;
-}
-MACROLIKE CONSTFUNC float Num32$clamped(float x, float low, float high) {
- return (x <= low) ? low : (x >= high ? high : x);
-}
+CONSTFUNC bool Num32$is_between(const float x, const float low, const float high);
+CONSTFUNC float Num32$clamped(float x, float low, float high);
MACROLIKE CONSTFUNC float Num32$from_num(Num_t n) { return (float)n; }
#ifdef __GNUC__
#pragma GCC diagnostic push