aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math/big
AgeCommit message (Collapse)Author
2025-09-13std.math.big.int: normalize zero result for small multiplicationsmlugg
Resolves: #25221
2025-08-29std.Io: delete GenericReaderAndrew Kelley
and delete deprecated alias std.io
2025-08-11std.ArrayList: make unmanaged the defaultAndrew Kelley
2025-08-05std: replace various mem copies with `@memmove`Andrew Kelley
2025-07-22aarch64: add new from scratch self-hosted backendJacob Young
2025-07-11Remove numerous things deprecated during the 0.14 release cycleLinus Groh
Basically everything that has a direct replacement or no uses left. Notable omissions: - std.ArrayHashMap: Too much fallout, needs a separate cleanup. - std.debug.runtime_safety: Too much fallout. - std.heap.GeneralPurposeAllocator: Lots of references to it remain, not a simple find and replace as "debug allocator" is not equivalent to "general purpose allocator". - std.io.Reader: Is being reworked at the moment. - std.unicode.utf8Decode(): No replacement, needs a new API first. - Manifest backwards compat options: Removal would break test data used by TestFetchBuilder. - panic handler needs to be a namespace: Many tests still rely on it being a function, needs a separate cleanup.
2025-07-09std: replace formatInteger with formatNumberAndrew Kelley
2025-07-08std: revert big int test to master branchAndrew Kelley
oops, it depends on usize
2025-07-07std.io.Writer.printValue: rework logicAndrew Kelley
Alignment and fill options only apply to numbers. Rework the implementation to mainly branch on the format string rather than the type information. This is more straightforward to maintain and more straightforward for comptime evaluation. Enums support being printed as decimal, hexadecimal, octal, and binary. `formatInteger` is another possible format method that is unconditionally called when the value type is struct and one of the integer-printing format specifiers are used.
2025-07-07std.fmt: fully remove format string from format methodsAndrew Kelley
Introduces `std.fmt.alt` which is a helper for calling alternate format methods besides one named "format".
2025-07-07std.fmt: breaking API changesAndrew Kelley
added adapter to AnyWriter and GenericWriter to help bridge the gap between old and new API make std.testing.expectFmt work at compile-time std.fmt no longer has a dependency on std.unicode. Formatted printing was never properly unicode-aware. Now it no longer pretends to be. Breakage/deprecations: * std.fs.File.reader -> std.fs.File.deprecatedReader * std.fs.File.writer -> std.fs.File.deprecatedWriter * std.io.GenericReader -> std.io.Reader * std.io.GenericWriter -> std.io.Writer * std.io.AnyReader -> std.io.Reader * std.io.AnyWriter -> std.io.Writer * std.fmt.format -> std.fmt.deprecatedFormat * std.fmt.fmtSliceEscapeLower -> std.ascii.hexEscape * std.fmt.fmtSliceEscapeUpper -> std.ascii.hexEscape * std.fmt.fmtSliceHexLower -> {x} * std.fmt.fmtSliceHexUpper -> {X} * std.fmt.fmtIntSizeDec -> {B} * std.fmt.fmtIntSizeBin -> {Bi} * std.fmt.fmtDuration -> {D} * std.fmt.fmtDurationSigned -> {D} * {} -> {f} when there is a format method * format method signature - anytype -> *std.io.Writer - inferred error set -> error{WriteFailed} - options -> (deleted) * std.fmt.Formatted - now takes context type explicitly - no fmt string
2025-06-15std: disable test on LLVM (#24191)mlugg
2025-06-15big.int: implement float conversionsJacob Young
These conversion routines accept a `round` argument to control how the result is rounded and return whether the result is exact. Most callers wanted this functionality and had hacks around it being missing. Also delete `std.math.big.rational` because it was only being used for float conversion, and using rationals for that is a lot more complex than necessary. It also required an allocator, whereas the new integer routines only need to be passed enough memory to store the result.
2025-05-17x86_64: rewrite scalar `<<|`Jacob Young
Closes #23035
2025-04-16improve test syntax for better stack trace in case of failuresamy007
2025-04-14std.math.big: add and update testssamy007
2025-04-14std.math.big.int: changed llshr and llshl implementationsamy007
2025-04-13std.math.big.int: remove setRuntimeSafetysamy007
2025-03-24big.int: return normalized results from `{add,sub}Carry`David Rubin
2025-03-21big.int: fix negative multi-limb shift right adjust crashJacob Young
2025-03-21big.int: fix yet another truncate bugJacob Young
Too many bugs have been found with `truncate` at this point, so it was rewritten from scratch. Based on the doc comment, the utility of `convertToTwosComplement` over `r.truncate(a, .unsigned, bit_count)` is unclear and it has a subtle behavior difference that is almost certainly a bug, so it was deleted.
2025-02-23std.math.big.int: Support strings up to base 36Linus Groh
Co-Authored-By: samy007 <samy2014@free.fr>
2025-02-18x86_64: rewrite scalar `@ctz`Jacob Young
2025-02-17std.Target: Remove functions that just wrap component functions.Alex Rønne Petersen
Functions like isMinGW() and isGnuLibC() have a good reason to exist: They look at multiple components of the target. But functions like isWasm(), isDarwin(), isGnu(), etc only exist to save 4-8 characters. I don't think this is a good enough reason to keep them, especially given that: * It's not immediately obvious to a reader whether target.isDarwin() means the same thing as target.os.tag.isDarwin() precisely because isMinGW() and similar functions *do* look at multiple components. * It's not clear where we would draw the line. The logical conclusion before this commit would be to also wrap Arch.isX86(), Os.Tag.isSolarish(), Abi.isOpenHarmony(), etc... this obviously quickly gets out of hand. * It's nice to just have a single correct way of doing something.
2025-02-06x86_64: rewrite scalar `@truncate`Jacob Young
2025-02-03compiler,std: implement ZON supportMason Remaley
This commit allows using ZON (Zig Object Notation) in a few ways. * `@import` can be used to load ZON at comptime and convert it to a normal Zig value. In this case, `@import` must have a result type. * `std.zon.parse` can be used to parse ZON at runtime, akin to the parsing logic in `std.json`. * `std.zon.stringify` can be used to convert arbitrary data structures to ZON at runtime, again akin to `std.json`.
2025-01-18autodocs: reflow comment to prevent it from been put in blockquoteandrewkraevskii
2025-01-16x86_64: implement switch jump tablesJacob Young
2025-01-16x86_64: implement clz and notJacob Young
2024-10-12Remove packed_int_array usage from WasmPageAllocator and BigIntKrzysztof Wolicki
2024-09-06std.math.big.int: fix shiftRight sign handlingIan Johnson
Closes #21311 The sign of the result `r` needs to be initialized before the correction `r.addScalar(r.toConst(), -1)`, or the intended end result could be off by 2 (depending on the original sign of `r`).
2024-08-28std: update `std.builtin.Type` fields to follow naming conventionsmlugg
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
2024-08-16Dwarf: rework self-hosted debug info from scratchJacob Young
This is in preparation for incremental and actually being able to debug executables built by the x86_64 backend.
2024-07-23add std.testing.random_seedAndrew Kelley
closes #17609
2024-07-12Fix right shift on negative BigIntsTau
Closes #17662.
2024-05-21std.math.big.int.Managed: adjust size of arg for limbs_buffer in format()poypoyan
2024-05-08fix wrong int alignment for i65..i127 on x86 archAndrew Kelley
2024-05-08restructure unit test to be easier to debugAndrew Kelley
2024-04-13std: fix big int llshr to respect aliasing (#19612)Андрей Краевский
2024-03-11math.big.int: fix incorrect `bitAnd` behaviortinusgraglin
2024-02-26Change many test blocks to doctests/decltestsRyan Liptak
2024-02-26Remove redundant test name prefixes now that test names are fully qualifiedRyan Liptak
Follow up to #19079, which made test names fully qualified. This fixes tests that now-redundant information in their test names. For example here's a fully qualified test name before the changes in this commit: "priority_queue.test.std.PriorityQueue: shrinkAndFree" and the same test's name after the changes in this commit: "priority_queue.test.shrinkAndFree"
2024-02-12x86_64: implement `@clz` and `@ctz` of big integersJacob Young
2024-02-12x86_64: implement shifts of big integersJacob Young
2024-02-08Replace std.rand references with std.Randome4m2
2024-01-16std: remove deprecated APIAndrew Kelley
2023-11-19lib: correct unnecessary uses of 'var'mlugg
2023-11-14x86_64: actually track state during `@divFloor` of `i128`Jacob Young
Closes #17998
2023-11-14std: disable failing testJakub Konka
2023-11-08std.math.big: fix sqrt with bits > limb_bitstison
Signed-off-by: tison <wander4096@gmail.com>