You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std.math.sign: Narrow integer return types to possible values
This may be a breaking change for callers that depend on the return type
being identical to the input type. For example, `sign(u32) * i8 + i8`
could now overflow. Callers can add an explicit type annotation to avoid
that situation.
If Zig ever allows small integer types to coerce to floats (see #18614),
then it might make sense to always return an integer. In the meantime,
I figured it would be too annoying for users dealing with floats.
0 commit comments