update std.math functions to widen instead of returning errors #4481
Labels
breaking
Implementing this issue could cause existing code to no longer compile or have different behavior.
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
standard library
This issue involves writing Zig code for the standard library.
Milestone
I propose to update:
std.math.mul
std.math.add
std.math.sub
To not have
error.Overflow
error. Instead something like this:And then
std.math.cast
can be used to cast the value to a smaller integer, or returnerror.Overflow
.The text was updated successfully, but these errors were encountered: