summaryrefslogtreecommitdiffstats
path: root/src/synth_math.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/synth_math.h')
-rw-r--r--src/synth_math.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/synth_math.h b/src/synth_math.h
index 74dec4c..2dd9f83 100644
--- a/src/synth_math.h
+++ b/src/synth_math.h
@@ -18,14 +18,14 @@ gcd(long long a, long long b)
static long long
lcm(long long a, long long b)
{
- return (a / gcd(a, b)) * b;
+ return (a / gcd(a, b)) * b;
}
static float
-clamp(float f)
+clamp(float f, int min, int max)
{
- if (f <= -1) return -0.9999;
- if (f >= 1) return 0.9999;
+ if (f <= min) return min + 0.0001;
+ if (f >= max) return max - 0.0001;
return f;
}