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 9:40 AM To: boost@lists.boost.org Subject: Re: [boost] BigInt divide-by-zero handling
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.
Heres another possible justification: template<typename IntType> T make_T(IntType a) { ... ..b/a.. } This function behaves differently for IntType=int or IntType=BigInt.
participants (1)
-
Sohail Somani