4 ms·
I can't find anything related to division returning an error type. Looking at std.math.divExact, rem, mod, add, sub, etc. it looks to me like you're expected to
by ben-schaaf 7mo ago
I can't find anything related to division returning an error type. Looking at std.math.divExact, rem, mod, add, sub, etc. it looks to me like you're expected to use these if you don't want to panic.
- Turskarama 7mo agoActually you're right, I was going by the source code which was in the link of the comment you replied to, but I missed that that was specifically for divExact and not just primitive division.
- MaulingMonkey 7mo ago(Rust has a similar fn: https://doc.rust-lang.org/std/primitive.isize.html#method.checked_div https://doc.rust-lang.org/std/primitive.isize.html#method.ch... )