Re: [boost] BigInt divide-by-zero handling

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Gerhard Wesp Sent: Wednesday, May 17, 2006 2:29 AM To: boost@lists.boost.org Subject: Re: [boost] BigInt divide-by-zero handling
Since ordinary ints just throw an exception, and my goal is to make
I don't think ordinary ints throw exceptions. Nevertheless, I think you should.
I disagree. I check for divide by zero or write code that doesn't allow them to happen. If I wanted an exception for any possible operation, I'd use java (I'm not flaming - I think). Do an assertion in debug mode, U.B. in release. This is most sensible for a type that is an extension of a built-in type.

On Wed, May 17, 2006 at 09:22:58AM -0700, Sohail Somani wrote:
Do an assertion in debug mode, U.B. in release. This is most sensible for a type that is an extension of a built-in type.
Seems OK also. I just happen to think that whereever behaviour *can* be defined, it should (and do it as the ints whereever it is defined what they do!). There's already too much U.B. in C++. A division by zero exception in an arbitrary size integer package would not incur any measurable overhead, I think. Regards -Gerhard -- Gerhard Wesp ZRH office voice: +41 (0)44 668 1878 ZRH office fax: +41 (0)44 200 1818 For the rest I claim that raw pointers must be abolished.
participants (2)
-
Gerhard Wesp
-
Sohail Somani