3 ms·
(num * num2)/num = num2 The division cancels out the multiplication. Just like if you were doing arithmetic on paper as you did in school. There's nothing more
by chrisseaton 10y ago
(num * num2)/num = num2
The division cancels out the multiplication. Just like if you were doing arithmetic on paper as you did in school. There's nothing more to it than that is there? What inputs do you think it's incorrect for in clang?
Overflow is of course undefined.
- cyphar 10y agoUnless num is zero. In which case you won't get a floating point signal, you get a number that doesn't male sense.
- chrisseaton 10y agoBut a program with division by zero is undefined anyway.