Commit Graph

66 Commits

Author SHA1 Message Date
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
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
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
7642e0a0e0 Require @(init) and @(fini) to be proc "contextless" () 2025-08-08 12:10:01 +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
gingerBill
149ecafdef Remove the need for rand in core:math/big 2024-06-15 15:43:57 +01:00
Laytan
d7fdccb08c fix a couple of -vet-style failures after f54977336b 2024-05-09 19:39:48 +02: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
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
c85ac955f7 Simplify docs to hide the copyright 2022-01-17 19:00:47 +00:00
gingerBill
87952fdb8e big.Rat (Experimental) 2021-10-29 12:40:54 +01:00
gingerBill
5006674a9b Correct math/big 2021-09-08 13:14:13 +01:00
gingerBill
ca33cb990b Strip semicolons in core which were missing 2021-09-08 13:12:38 +01:00
Jeroen van Rijn
5619b349be big: Remove core:fmt usage + Add a little demo to examples/demo. 2021-09-06 23:26:19 +02:00
gingerBill
2800d4b8d0 Merge branch 'master' into optional-semicolons 2021-09-06 16:46:57 +01:00
Jeroen van Rijn
de5d897b5c Add internal_int_(pack, unpack). 2021-09-06 12:57:48 +02:00
Jeroen van Rijn
1f5ce91ae2 big: Add internal_random_prime. 2021-09-05 10:40:35 +02:00
Jeroen van Rijn
65a15e9c06 big: Add internal_int_exponent_mod. 2021-09-01 19:13:47 +02:00
gingerBill
720884e0f1 Strip even more semicolons if followed by a } or ) on the same line 2021-08-31 23:47:57 +01:00
gingerBill
f57201bbd1 Remove unneeded semicolons from the core library 2021-08-31 22:32:53 +01:00
gingerBill
251da264ed Remove unneeded semicolons from the core library 2021-08-31 22:21:13 +01:00
Jeroen van Rijn
23d29be4d8 big: Update license to BSD-3. 2021-08-19 12:12:59 +02:00
Jeroen van Rijn
8b49bbb0fc big: Add _private_mul_karatsuba. 2021-08-16 16:10:10 +02:00
gingerBill
e3fef2dade Improve parsing for or_return; allow #force_inline foo() or_return; 2021-08-16 11:58:50 +01:00
gingerBill
c27b8a71fd Replace err != nil with or_return where appropriate 2021-08-15 17:52:10 +01:00
Jeroen van Rijn
eb22a49b02 big: Add int_from_bytes_*. 2021-08-11 20:59:54 +02:00
Jeroen van Rijn
ee24f2dd37 big: Improve int_to_bytes_*. 2021-08-11 20:59:54 +02:00
Jeroen van Rijn
12f9b6db63 big: Add int_to_bytes_{big, little} + Python compatible variants. 2021-08-11 20:59:54 +02:00
Jeroen van Rijn
851780b8f4 big: Add arguments and usage to test.py. 2021-08-11 20:59:54 +02:00
Jeroen van Rijn
6c681b258c big: Add _private_int_sqr_comba. 2021-08-11 20:59:54 +02:00
Jeroen van Rijn
1f91a2fe65 big: Finish refactor. 2021-08-11 20:59:54 +02:00
Jeroen van Rijn
19ff27788c big: Refactoring. 2021-08-11 20:59:54 +02:00
Jeroen van Rijn
d505a05d36 big: More refactoring. 2021-08-11 20:59:53 +02:00
Jeroen van Rijn
07dca737f0 big: More refactoring. 2021-08-11 20:59:53 +02:00
Jeroen van Rijn
6d34a8344a big: Refactor helpers. 2021-08-11 20:59:53 +02:00
Jeroen van Rijn
777e17d80f big: Improve tunables. 2021-08-11 20:59:53 +02:00
Jeroen van Rijn
9890e7cfeb big: Improved zero_unused helper. 2021-08-11 20:59:53 +02:00
Jeroen van Rijn
f8442e0524 big: Split up mul into internal and public parts. 2021-08-11 20:59:53 +02:00
Jeroen van Rijn
511057ca36 big: Improve timing code. 2021-08-11 20:59:53 +02:00
Jeroen van Rijn
35d8976de4 bit: Optimized int_bitfield_extract. 2021-08-11 20:59:53 +02:00
Jeroen van Rijn
463003e86a bit: Improved bitfield extraction. 2021-08-11 20:59:53 +02:00
Jeroen van Rijn
85a2a8815e big: Some more work on constants. 2021-08-11 20:59:53 +02:00
Jeroen van Rijn
47397a6a48 Add faster divison. 2021-08-11 20:59:53 +02:00
Jeroen van Rijn
2323ca1622 big: Add MATH_BIG_FORCE_64/32_BIT flags. 2021-08-11 20:59:52 +02:00
Jeroen van Rijn
fc0a92f8ac big: Add constants. 2021-08-11 20:59:52 +02:00
Jeroen van Rijn
97d80d03f9 big: Error.None -> nil 2021-08-11 20:59:52 +02:00
Jeroen van Rijn
491e4ecc74 big: Add binary split factorial. 2021-08-11 20:59:52 +02:00