Commit Graph

204 Commits

Author SHA1 Message Date
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
gingerBill f7211408fc Merge pull request #1544 from FancyKillerPanda/build_ignore
Changed `//+ignore` to `//+build ignore` and emit a warning for unknown tags
2022-11-03 12:58:26 +00:00
cui fliter dc8b7a0eb8 fix some typos
Signed-off-by: cui fliter <imcusg@gmail.com>
2022-08-05 20:10:20 +08:00
FancyKillerPanda 62ff8daa78 Changed //+ignore to //+build ignore. 2022-02-24 12:23:54 +11:00
gingerBill b8c4bf2afb Add #partial [Enum]Type{...} support to check for missing enumerated array fields 2022-02-05 14:02:21 +00:00
gingerBill 6418ec3b21 Correct #sparse usage and error messages 2022-02-05 13:09:16 +00:00
gingerBill fb01dfe048 Improve docs_writer.cpp 2022-01-17 22:17:07 +00:00
gingerBill c85ac955f7 Simplify docs to hide the copyright 2022-01-17 19:00:47 +00:00
Jeroen van Rijn 938744b276 [math/big] Rename internal_int_shl_digit to _private_int_shl_leg.
Same for the SHR variant. These are pure implementation details to shift by a leg/word at a time.
Prevent accidental usage.
2021-12-11 15:22:24 +01:00
gingerBill 84b84d9f7d Fix rat_set_f64 2021-12-11 12:47:05 +00:00
Jeroen van Rijn c771ea9794 Merge pull request #1358 from Kelimion/big_math_fix
[math/big] Return 0, .Integer_Underflow if T = unsigned and bigint is negative.
2021-12-09 16:41:37 +01:00
gingerBill 94bad4d786 Merge branch 'master' of https://github.com/odin-lang/Odin 2021-12-09 15:36:12 +00:00
gingerBill 1e17d5d86f Add utility procedures to get low values 2021-12-09 15:34:35 +00:00
gingerBill 1e9b30666f Minor style change 2021-12-09 15:34:17 +00:00