aboutsummaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2024-09-10 15:31:57 +0200
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2024-09-10 15:31:57 +0200
commitbeb10cce638e093074d208fef059f2f402658ea9 (patch)
tree9bcd872703fc970e852b47af4fa467b8812adad3 /core/math
parent4df668fa220528e26669fd55b36302a335e73361 (diff)
Fix #4227
Diffstat (limited to 'core/math')
-rw-r--r--core/math/math.odin6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/math/math.odin b/core/math/math.odin
index f5e904da6..0e21afa67 100644
--- a/core/math/math.odin
+++ b/core/math/math.odin
@@ -444,11 +444,11 @@ bias :: proc "contextless" (t, b: $T) -> T where intrinsics.type_is_numeric(T) {
return t / (((1/b) - 2) * (1 - t) + 1)
}
@(require_results)
-gain :: proc "contextless" (t, g: $T) -> T where intrinsics.type_is_numeric(T) {
+gain :: proc "contextless" (t, g: $T) -> T where intrinsics.type_is_float(T) {
if t < 0.5 {
- return bias(t*2, g)*0.5
+ return bias(t*2, g) * 0.5
}
- return bias(t*2 - 1, 1 - g)*0.5 + 0.5
+ return bias(t*2 - 1, 1 - g) * 0.5 + 0.5
}