227 Commits
Author SHA1 Message Date
Jeroen van Rijn f82fbc9405 -vet-tabs 2026-03-15 11:06:22 +01:00
mlgudi 76da2c3233 mul_high: fix aliasing bug when dest overlaps input 2026-03-15 02:47:26 +00:00
mlgudi 84b38810f1 powmod: fix Montgomery branch calling Barrett implementation 2026-03-15 02:46:30 +00:00
Jeroen van Rijn a7bf06eb5f Fix cast. 2026-02-15 17:15:48 +01:00
Jeroen van Rijn 5c95a48bc7 Clean up core:math/big
- Deprecate the u64/u32 implementation so we can use fewer nails and have an easier time of maintaining and optimizing the package going forward. The remaining implementation still works on 32-bit targets, it's just a smidge less efficient.

- Use only 1 nail instead of 4. The tests now run 3.5% faster as a result.

Future optimizations may including using fully packed backing (no nails) using `intrinsics.overflow_*` to handle borrow and carry safely.
2026-02-15 17:00:53 +01:00
Jeroen van Rijn d8f2eb2717 Remove core:mem import from core:math/big. 2026-02-12 14:37:28 +01:00
Jeroen van Rijn 71f343bc85 Remove core:mem import from core:math/big. 2026-02-12 13:56:05 +01:00
Jeroen van Rijn e7dbabf668 core:os -> core:os/old && core:os/os2 -> core:os 2026-02-09 15:50:21 +01:00
Jeroen van Rijn 8ed264680b Remove all core:os imports from JS targets
Fix `local_tz_name` on FreeBSD.
2026-02-09 15:07:27 +01:00
Jeroen van Rijn 9c1a9c80f8 core:os -> core:os/os for core:math/big 2026-02-08 12:42:28 +01:00
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