180 Commits

Author SHA1 Message Date
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
Jeroen van Rijn
b2b79b86f0 [math/big] Return 0, .Integer_Underflow if trying to get a negative number to an unsigned int. 2021-12-09 16:31:54 +01:00
Jeroen van Rijn
c94098c2ab [math/big] Fix int_set and int_get. 2021-12-09 16:14:04 +01:00
gingerBill
9d4fe90356 Fix bugs in big.Rat caused by typos 2021-12-07 17:35:41 +00:00
gingerBill
6a101e69a2 Implement ldexp and frexp in native Odin 2021-11-16 14:04:49 +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
f7601a759b Move math/big tests under tests/. 2021-09-07 19:51:56 +02:00
Jeroen van Rijn
fbebf4bc4e big: Add Python implementation of LCM. 2021-09-07 14:17:14 +02:00
Jeroen van Rijn
abb15ddb38 big: Implement isqrt in Python for the tests. 2021-09-07 13:55:37 +02:00
Jeroen van Rijn
c4ec459d28 bit: Force Python3 for CI. 2021-09-07 13:26:34 +02:00
Jeroen van Rijn
86cfb2ea82 big CI: Set relative path to Odin. 2021-09-07 13:22:44 +02:00
Jeroen van Rijn
0605a9f239 big: Run tests under CI. 2021-09-07 13:17:47 +02:00
Jeroen van Rijn
008048e199 big: Move tests into their own package. 2021-09-07 12:06:58 +02: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
Jeroen van Rijn
2c13315e72 compress: Update BSD-3 license + remove semicolons from compressed example. 2021-09-06 21:33:40 +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
3faac14d62 big: Add ASCII file import/export. 2021-09-05 15:50:23 +02:00
Jeroen van Rijn
f33d0725db big: Add Extended Euclidean algorithm. 2021-09-05 14:03:02 +02:00
Jeroen van Rijn
1f5ce91ae2 big: Add internal_random_prime. 2021-09-05 10:40:35 +02:00
Jeroen van Rijn
f2c5c26f2c big: Add internal_int_prime_next_prime. 2021-09-04 16:31:05 +02:00
Jeroen van Rijn
52da5b8724 big: Default to Frobenius-Underwood. It's 10% faster than Lucas-Selfridge. 2021-09-03 23:54:54 +02:00
Jeroen van Rijn
b1ed7fc6b9 big: Add Lucas-Selfridge. 2021-09-03 23:54:54 +02:00