4 ms·
I mean you get an error but not a segfault. Rust crashes on division by zero but honestly, how many crashes have you encountered in the real world due to divisi
by adamnemecek 13y ago
I mean you get an error but not a segfault. Rust crashes on division by zero but honestly, how many crashes have you encountered in the real world due to division by zero?
- pbsd 13y agoProbably quite a few. There's also more than just division by 0 to be wary of: http://blog.cmpxchg8b.com/2013/02/the-other-integer-overflow.html http://blog.cmpxchg8b.com/2013/02/the-other-integer-overflow...
- dbaupp 13y agoYou get a task failure (similar to an exception) on division by 0 too.
- berkut 13y agoQuite a few if you include what happens after a division by zero without proper checking / clamping. Had one the other day when renormalising a Cumulative distribution function wasn't taking into account a possible empty set, and the lookup of the index was invalid due to the division by zero.