From d17ee79470e16327049350d462056292348cf6a0 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Tue, 7 Oct 2025 14:30:13 +0100 Subject: [PATCH] Fix #5764 --- core/math/math.odin | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/math/math.odin b/core/math/math.odin index b99a97bc1..b399b4dac 100644 --- a/core/math/math.odin +++ b/core/math/math.odin @@ -402,7 +402,12 @@ remap :: proc "contextless" (old_value, old_min, old_max, new_min, new_max: $T) if old_range == 0 { return new_range / 2 } - return ((old_value - old_min) / old_range) * new_range + new_min + + when intrinsics.type_is_integer(T) { + return (((old_value - old_min)) * new_range) / old_range + new_min + } else { + return ((old_value - old_min) / old_range) * new_range + new_min + } } @(require_results)