From 398af659e59740463f569f4424c7e953d5968baf Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 24 Mar 2024 13:33:30 +0000 Subject: [PATCH] Fix #3323 --- core/math/linalg/extended.odin | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/math/linalg/extended.odin b/core/math/linalg/extended.odin index eee339245..22c37dd0e 100644 --- a/core/math/linalg/extended.odin +++ b/core/math/linalg/extended.odin @@ -326,6 +326,7 @@ ln :: proc "contextless" (x: $T) -> (out: T) where IS_FLOAT(ELEM_TYPE(T)) { @(require_results) log2 :: proc "contextless" (x: $T) -> (out: T) where IS_FLOAT(ELEM_TYPE(T)) { + INVLN2 :: 1.4426950408889634073599246810018921374266459541529859341354494069 when IS_ARRAY(T) { for i in 0.. (out: T) where IS_FLOAT(ELEM_TYPE(T)) { @(require_results) log10 :: proc "contextless" (x: $T) -> (out: T) where IS_FLOAT(ELEM_TYPE(T)) { + INVLN10 :: 0.4342944819032518276511289189166050822943970058036665661144537831 when IS_ARRAY(T) { for i in 0.. (out: T) where IS_FLOAT(ELEM_TYPE(T)) { out[i] = math.ln(x[i]) / math.ln(cast(ELEM_TYPE(T))b[i]) } } else { - out = INVLN10 * math.ln(x) / math.ln(cast(ELEM_TYPE(T))b) + out = math.ln(x) / math.ln(cast(ELEM_TYPE(T))b) } return }