Jeroen van Rijn
976bb52af7
Always use new itoa method when MATH_BIG_FORCE_32_BIT
2025-11-28 23:08:17 +01:00
Jeroen van Rijn
be38ba58b3
Another little bit faster.
2025-11-27 18:27:55 +01:00
Jeroen van Rijn
3cdaf06fc8
Switch between old and new itoa method based on optimization level + digit size
2025-11-27 16:10:32 +01:00
Jeroen van Rijn
1ea5990be2
Speed up big.itoa
...
Extract 18 (64-bit) or 8 (32-bit) digits per big division.
This gives a 2.5x speedup for a 1024-bit bigint.
2025-11-27 15:35:05 +01:00
gingerBill
78d8059ebe
Use @(rodata) where possible
2025-11-27 10:24:22 +00:00
gingerBill
0d16ab2783
Add alias Okay = None
2025-11-27 09:14:39 +00:00
gingerBill
c63fa3f663
Use < 0 instead of == -1 for comparisons
2025-11-27 09:13:21 +00:00
gingerBill
53876907c6
Handle Allocator_Error correctly in core:math/big
2025-11-27 09:10:03 +00:00
Jeroen van Rijn
56aab55d82
Fix #5931
...
Fix #5931 and add test case for it.
2025-11-18 15:37:57 +01:00
gingerBill
842cfee0f3
Change Odin's LICENSE to zlib from BSD 3-clause
...
This change was made in order to allow things produced with Odin and using Odin's core library, to not require the LICENSE to also be distributed alongside the binary form.
2025-10-28 14:38:25 +00:00
Jeroen van Rijn
7a9ea3ee6d
Further overhaul of package line comments.
2025-10-09 23:05:29 +02:00
Jeroen van Rijn
c4c2431997
Package lines for core:math and more.
2025-10-09 19:56:21 +02:00
Jeroen van Rijn
3c9538c708
Change the way math/big constants are initialized
2025-09-10 21:02:24 +02:00
gingerBill
8b860da2eb
Remove unused import
2025-08-08 12:12:08 +01:00
gingerBill
7642e0a0e0
Require @(init) and @(fini) to be proc "contextless" ()
2025-08-08 12:10:01 +01:00
blob1807
f2490191b6
Fix memory leak in internal_rat_norm
2025-06-23 02:44:00 +10:00
Jeroen van Rijn
9dafd77bc0
Turn core:math/bìg tests into regular core:testing tests.
...
`core:math/big` has been verified against Python's big integer implementation long enough.
Turn it into a regular regression test using the `core:testing` framework, testing against
a generated corpus of test vectors.
2025-06-11 00:40:52 +02:00
Jeroen van Rijn
4f4839ecc5
Add initial tests for big rationals
2025-06-10 16:46:12 +02:00
Feoramund
4236b043e2
Move negation in internal_rat_to_float to end of procedure
...
This should cause a compiler error, due to the assignment to a named
return value in a deferred block.
Fixes #4565
2025-06-10 08:34:07 -04:00
Jeroen van Rijn
4b36306674
Deprecate old @(deprecated) things.
2025-06-06 10:42:34 +02:00
Barinzaya
d402b7408d
Fix a range check in int_atoi in core:math/big.
...
The check seems to have been assuming that rune comparisons are
unsigned, but they're signed. This was causing an assertion failure for
certain input characters (anything with an ASCII value less than
'+'/43).
2025-05-24 11:31:37 -04:00
Karl Zylinski
19f0127e55
Moved all packages in core, base, vendor, tests and examples to use new #+ file tag syntax.
2024-09-14 18:27:49 +02:00
gingerBill
eb799393d5
Fix -vet-tabs issues
2024-08-24 13:56:41 +01:00
gingerBill
8642d719f0
Imply #no_capture to all variadic parameters
2024-07-14 12:19:47 +01:00
gingerBill
c7bd954752
Add more uses of #no_capture
2024-07-14 11:56:04 +01:00
Jeroen van Rijn
476d0087c8
Fix bug in div3 fast path.
2024-06-29 23:14:12 +02:00
gingerBill
e296d6fb90
Fix loads of indentation issues with mixing spaces and tabs
2024-06-29 19:50:51 +01:00
gingerBill
149ecafdef
Remove the need for rand in core:math/big
2024-06-15 15:43:57 +01:00
Jeroen van Rijn
908a6ff2d4
Elide unnecessary condition
2024-06-14 21:34:05 +02:00
Josh Jones
759139089f
Fix big.shrink not actually shrinking
2024-06-14 19:58:13 +02:00
Jeroen van Rijn
5985c6e3df
Merge pull request #3718 from Feoramund/add-missing-big-atoi-alias
...
Add missing `string_to_int` alias in `core:math/big`
2024-06-10 03:58:56 +02:00
Feoramund
70820c2c40
Add missing string_to_int alias in core:math/big
2024-06-09 21:42:31 -04:00
Feoramund
5fbd876db1
Add permutation & combination procedures to core:math/big
2024-06-09 20:42:04 -04:00
Feoramund
01ad69413a
Remove unused code in internal_random_prime
2024-05-28 01:36:44 -04:00
Laytan
d7fdccb08c
fix a couple of -vet-style failures after f54977336b
2024-05-09 19:39:48 +02:00
Feoramund
a294f067a9
Fix big.internal_random_prime with Second_MSB_On
2024-04-15 05:49:15 -04:00
gingerBill
29e5f94c2a
Add #no_broadcast procedure parameter to disallow automatic array programming broadcasting on procedure arguments
2024-03-21 11:52:48 +00:00
Ed Yu
dd74a57c44
Expose internal invmod and int_exponent_mod with more consistent naming
2024-03-12 11:01:09 -07:00
Jeroen van Rijn
db03c86544
Fix typo in big.internal_invmod
...
Fixes #3253
2024-03-08 18:05:34 +01:00
Ed Yu
de41c2256d
For invmod, b has to be > 1, fix a logic typo
2024-03-04 10:16:19 -08:00
Jeroen van Rijn
4c35633e01
math.big constants were no longer initialized
...
Fixes #3243
2024-03-03 15:09:38 +01:00
gingerBill
3e7e779abf
Replace core:* to base:* where appropriate
2024-01-28 22:18:51 +00:00
Jeroen van Rijn
f79efd43e4
Fix missing clamp in core:math/big random.
2023-11-27 12:43:24 +01:00
gingerBill
d27109640e
Partial pseudo-revert
2023-10-02 20:59:43 +01:00
gingerBill
5023313c03
Minor cleanups to the core library
2023-09-30 20:26:04 +01:00
gingerBill
14adcb9db8
Use or_break and or_continue where appropriate in the core library
2023-09-30 15:34:39 +01:00
gingerBill
2ac463f003
Rename bitwise operations to bit_or etc
2023-09-28 16:40:01 +01:00
gingerBill
3dec55f009
Replace x in &y Use &v in y syntax through core & vendor for switch/for statements
2023-06-26 15:42:57 +01:00
gingerBill
9b54b99bf6
Use positional and named arguments within the core library
2023-06-21 01:17:05 +01:00
gingerBill
7cda64e52d
Add parentheses around or_return uses in an unary expression
2023-04-27 11:17:23 +01:00