Boost logo

Boost :

Subject: Re: [boost] [review] Multiprecision review (June 8th - 17th, 2012)
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-06-25 00:05:28


AMDG

On 06/24/2012 07:58 PM, Edward Diener wrote:
>
> As a single example of this the gmp_int backend triggers a division by 0
> signal when one tries to divide the integer by 0; the tom_int raises a
> hardward signal with a division by 0; the cpp_int throws a
> std::runtime_error with a division by 0. I would like to see some means
> by which I could use any integer backend and know that a
> std::runtime_error would be thrown by a division by 0.
>

IMO, you should just avoid division by zero period.
As far as C++ itself is concerned, division by 0
is undefined behavior, so any code that wants to
handle any numeric type including builtins can't
assume anything about division by zero.

In Christ,
Steven Watanabe


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