Commit Graph
564 Commits
Author SHA1 Message Date
jakubtomsu e8aac50f8b math/rand math/bits dependency 2026-02-17 18:34:37 +01:00
gingerBill a7ed7ccd0c Merge pull request #6259 from odin-lang/bill/range-init
`for init; x in y {}` style loops (proof of concept)
2026-02-17 11:11:56 +00:00
gingerBill 6da4a6746f Add linalg.to_f16 2026-02-17 09:41:22 +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 b82512b4cf Restrict math.wrap to floats. 2026-02-11 22:15:15 +01:00
gingerBill 355b8a8c83 Merge pull request #6245 from odin-lang/new_os
`core:os/os2` -> `core:os` integration
2026-02-11 17:53:16 +00:00
jakubtomsu d492122bd4 import cleanup 2026-02-09 20:08:22 +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
Xotchkass edb70a8d75 optimized slice filling in xoshiro/pcg_random_generator_proc (#6001) 2026-01-13 21:11:01 +01:00
Wrath 7062f89bcd core:math/rand small documentation fix 2025-12-22 16:10:51 -05:00
gingerBill 6922ab15fb Merge pull request #5864 from Skyress-s/master
fix: linalg.quaternion_from_forward_and_up()
2025-12-01 12:31:55 +00:00
Andreas Stenmark ad11d3bea0 Fix #5978: choice_bit_set respects bit_set domain 2025-11-30 21:46:26 +01:00
Yawning Angel ea1f1e275d base/runtime: Add chacha8rand as the default RNG 2025-11-29 16:16:52 +09:00
Yawning Angel f74f93154a math/rand: Add xoshiro256**
This is extracted from the previos PR as an improved non-cryptographic
PRNG option.
2025-11-29 10:45:53 +09:00
Yawning Angel 110d869cd7 math/rand: Add a copy of the existing PCG PRNG
The switch to the new RNG will be a breaking change as the outputted
sequence will change for a given seed.  This is intended for backward
compatibility purposes only.
2025-11-29 10:45:53 +09:00
Jeroen van Rijn cbf9f59da0 Fix core:math/ease 2025-11-28 23:18: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
Xotchkass b8f8e6a8df changed panic to assert 2025-11-28 14:11:37 +02:00
Xotchkass a234f25fa5 Add range-based random number generation functions 2025-11-28 13:40:30 +02:00
Jeroen van Rijn be38ba58b3 Another little bit faster. 2025-11-27 18:27:55 +01:00
Jeroen van Rijn a6820020c7 Merge pull request #5968 from Xotchkass/rand_u_max
Add `uint32_max`, `uint64_max`, `uint128_max` and `uint_max` procs to `core:math/rand`
2025-11-27 16:12:09 +00: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
Xotchkass 0ed24953bb add uint32_max, uint64_max, uint128_max and uint_max procs to math/rand 2025-11-26 23:06:19 +02:00
Phil Homan 342a7dd112 rerrange math.sign and math.sign_bit overloads 2025-11-23 11:03:37 -08:00
Phil Homan 9131bca7ba add math.sign and math.sign_bit overloads for int types 2025-11-22 13:32:21 -08:00
Jeroen van Rijn 56aab55d82 Fix #5931
Fix #5931 and add test case for it.
2025-11-18 15:37:57 +01:00
gingerBill e5153a937b Merge pull request #5859 from odin-lang/bill/change-license
Change Odin's LICENSE to zlib from BSD 3-clause
2025-11-04 13:53:13 +00:00
NicknEma 7317704fd0 Fix docs on int*_max 2025-11-04 13:11:48 +01:00
thetarnav c63ad8b1cf Cleanup ease_inverse 2025-11-01 21:22:06 +01:00
thetarnav 78f9f8bbce Add ease inverse procedures 2025-11-01 21:11:32 +01:00
Mathias Mohn Mørch 9a321befd4 Fixed issue where the linalg.quaternion_from_forward_and_up could return incorrect values in certain scenarioes 2025-10-30 20:35:35 +01:00
Nick Driscoll 5fa41f9f03 Add half support to all proc groups and add ashalf proc group 2025-10-28 21:42:08 -04:00
Nick Driscoll f3b6ad01ab Add all half scalar, vector, and matrix types 2025-10-28 21:42:08 -04: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 ee93f48729 core:math/bits: Finish docs, add bitfield_extract + bitfield_insert test. 2025-10-14 23:30:38 +02:00
Jeroen van Rijn 347eae3a66 core:math/bits: Add docs + tests for rotate_left* and log2 2025-10-14 23:30:38 +02:00
Jeroen van Rijn 236111864e Link doc lines to source specifications. 2025-10-10 18:29:52 +02: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
gingerBill d17ee79470 Fix #5764 2025-10-07 14:30:13 +01:00