Date: Sun, 1 Feb 1998 19:55:26 +0200 (IST) From: Eli Zaretskii To: Guy Rauscher cc: djgpp AT delorie DOT com Subject: Re: Floating point exception question. In-Reply-To: <34D25AEE.1A79@netvision.net.il> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Fri, 30 Jan 1998, Guy Rauscher wrote: > So, if I have two numbers I want to multiply, how can I forsee the > exception and prevent it? How about the following: #include ... double a, b, c; if (a > DBL_MAX / b) throw_error ("a * b overflows, cannot multiply"); else c = a * b; I suggest to look at the header float.h, there are some quite useful constants there, besides DBL_MAX.