Boost logo

Boost :

From: Martin Bonner (martin.bonner_at_[hidden])
Date: 2006-05-16 11:27:02


Robert Ramey wrote

> Geoffrey Irving wrote:
>> Arguing that 1/0 should crash because that's what happens in "math"
>> is the same as arguing that 2*max_int should crash because that's
>> what happens in math...unless you have modulo arithmetic.
>
> True - I would argue that as well

Except that 2*max_int doesn't crash in mathematics. If we are talking
about the integers then then depending on /exactly/ which set of
integers we are talking about, either there isn't a value 'max_int', or
it is positive infinity (and doubling it leaves it unchanged). If we
are talking about modulo arithmetic, then doubling the largest possible
integer is perfectly well defined - it's just that the result is smaller
than the original value.

-- 
Martin Bonner
Martin.Bonner_at_[hidden]
Pi Technology, Milton Hall, Ely Road, Milton, Cambridge, CB4 6WZ,
ENGLAND Tel: +44 (0)1223 203894

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk