Re:Rust for C++ programmers – part 3: primitive types and op...
by adamnemecek on Wednesday April 23, 2014 @01:55AM
(#7632375)
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?
[ Parent
| on HN ]
Re:Rust for C++ programmers – part 3: primitive types and op...
by pbsd on Wednesday April 23, 2014 @02:02AM
(#7632402)
Probably 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...
Re:Rust for C++ programmers – part 3: primitive types and op...
by dbaupp on Wednesday April 23, 2014 @02:16AM
(#7632440)
You get a task failure (similar to an exception) on division by 0 too.
Re:Rust for C++ programmers – part 3: primitive types and op...
by berkut on Wednesday April 23, 2014 @04:15AM
(#7632771)
Quite 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.