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
Closeziglang#22749, closeziglang#22748, complete the "if the RHS is one, return the
LHS directly" TODOs, fix a crash on `intvec{undefined} / intvec{-1}` and
fix some compile errors:
* @divExact should not cause a compile error for integer undefined lhs
and runtime-known rhs, because execution is completely legal when
rhs == 1, and the policy on other operations has so far been to only
error if illegal behavior is guaranteed to happen.
* Compile errors for float division by zero make little sense given that
they are perfectly well-defined IEEE operations. The comments suggest
that this was possibly made illegal intentionally, maybe in service of
explicitness / "only way to do things" (so you have to use math.inf /
math.nan), but that would contradict the general principle that
comptime operations behave like runtime, and would add annoying
special-cases to some comptime calculations.
The @...Div() intrins allowed only *floating-point zero divided by
zero*, which should be, if anything, *more* ill-defined any other
division by zero, and probably shouldn't result in zero.
As an added bonus for fixing this bug, you can delete the lines in
test/behavior/x86_64/math.zig
referencing this issue!The text was updated successfully, but these errors were encountered: