mirror of
https://github.com/ziglang/zig.git
synced 2026-01-28 02:05:31 +00:00
Resolve docs inconsistency with Overflow builtins
In 41 (Undefined Behavior) . 5 (Integer Overflow) . 3 (Builtin Overflow Functions), it is stated that
> These builtins return a bool of whether or not overflow occurred, as well as returning the overflowed bits:
> * @addWithOverflow
> * @subWithOverflow
> * @mulWithOverflow
> * @shlWithOverflow
but in their definition says that it returns a `tuple`/`struct`.
Example;
`@addWithOverflow(a: anytype, b: anytype) struct { @TypeOf(a, b), u1 }`
Co-authored-by: zooster <r00ster91@proton.me>
This commit is contained in:
parent
adc6dec26b
commit
4942e4e870
@ -9804,8 +9804,8 @@ pub fn main() !void {
|
||||
{#header_close#}
|
||||
{#header_open|Builtin Overflow Functions#}
|
||||
<p>
|
||||
These builtins return a {#syntax#}bool{#endsyntax#} of whether or not overflow
|
||||
occurred, as well as returning the overflowed bits:
|
||||
These builtins return a tuple containing whether there was an overflow
|
||||
(as a {#syntax#}u1{#endsyntax#}) and the possibly overflowed bits of the operation:
|
||||
</p>
|
||||
<ul>
|
||||
<li>{#link|@addWithOverflow#}</li>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user