On 2010 Dec 2, at 8:35 PM, Chuck Guzis wrote:
On 2 Dec 2010 at 19:53, Brent Hilpert wrote:
The notion of integer divide is pretty well
defined. I'd be pretty
annoyed if I specced two ints, did a divide and didn't get back the
'standard' result. I don't have a C ref at hand, but in C at least, I
think it would be stretching acceptable claims of language flexibility
or non-specification for compiler implementors to be taking leniency
here.
Oh, I agree, but K&R is silent on exceptions.
..right, I was forgetting the OP's original problem was for / by 0, so
an exception case.
I was just thinking/conjecturing that if the implementors were doing
inherent floating point conversions, they better have confirmed that
the integer divide result would be correct for all (legal) combinations
of operand values, with no (say) off-by-1 situations or what-have-you.