aboutsummaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2024-03-03 15:09:38 +0100
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2024-03-03 15:09:38 +0100
commit4c35633e0147b481dd7b2352d6bdb603f78c6dc7 (patch)
tree918df96744fdb66e0c176f290e7f7f543d98d68a /core/math
parent674bd94f72b0faa50f64aaa0f0ad9ebee59f198b (diff)
math.big constants were no longer initializeddev-2024-03
Fixes #3243
Diffstat (limited to 'core/math')
-rw-r--r--core/math/big/helpers.odin7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/math/big/helpers.odin b/core/math/big/helpers.odin
index 8ab19e3e7..35be4f1fd 100644
--- a/core/math/big/helpers.odin
+++ b/core/math/big/helpers.odin
@@ -777,6 +777,11 @@ int_from_bytes_little_python :: proc(a: ^Int, buf: []u8, signed := false, alloca
*/
INT_ONE, INT_ZERO, INT_MINUS_ONE, INT_INF, INT_MINUS_INF, INT_NAN := &Int{}, &Int{}, &Int{}, &Int{}, &Int{}, &Int{}
+@(init, private)
+_init_constants :: proc() {
+ initialize_constants()
+}
+
initialize_constants :: proc() -> (res: int) {
internal_set( INT_ZERO, 0); INT_ZERO.flags = {.Immutable}
internal_set( INT_ONE, 1); INT_ONE.flags = {.Immutable}
@@ -788,7 +793,7 @@ initialize_constants :: proc() -> (res: int) {
*/
internal_set( INT_NAN, 1); INT_NAN.flags = {.Immutable, .NaN}
internal_set( INT_INF, 1); INT_INF.flags = {.Immutable, .Inf}
- internal_set( INT_INF, -1); INT_MINUS_INF.flags = {.Immutable, .Inf}
+ internal_set(INT_MINUS_INF, -1); INT_MINUS_INF.flags = {.Immutable, .Inf}
return _DEFAULT_MUL_KARATSUBA_CUTOFF
}