Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

When do I get floating point exceptions?

0 views
Skip to first unread message

Oliver A Ruebenacker

unread,
Aug 25, 2000, 3:00:00 AM8/25/00
to
Hello!

When do I get floating point exceptions?

Take care
Oliver

--
-- Oliver Axel Ruebenacker Physics Graduate Student --
-- Computational Condensed Matter Theory --
-- Univ. of Mass. at Amherst & Univ. of Karlsruhe, Germany --
-- http://www.ruebenacker.de/ Oli...@Ruebenacker.de --
-- 347 Prince House, UMass Amherst MA 01003 (413) 546 5919 --
-- Office: 414 Hasbrouck Lab (413) 545 0561 --

John Harrison

unread,
Aug 25, 2000, 3:00:00 AM8/25/00
to

"Oliver A Ruebenacker" <rueb...@lessing.oit.umass.edu> wrote in message
news:39a688e8$1...@oit.umass.edu...

> Hello!
>
> When do I get floating point exceptions?
>
> Take care
> Oliver
>

There is no such thing in standard C++. Your compiler might implement them
but it is doing so as an extension to the C++ language. The usual suspects
may generate floating point exceptions, why don't you try them and see?

1.0/0.0

sqrt(-1.0);

1e300*1e300

john


Victor Bazarov

unread,
Aug 25, 2000, 3:00:00 AM8/25/00
to
"John Harrison" <jah...@bigfoot.com> wrote...

Just don't write it like this in a program. Make sure you have
variables that you multiply so that the actual operation happens
during run-time, not compile-time. Otherwise your compiler is
likely to choke or give you an error.

Victor
--
Please remove capital A's from my address when replying by mail


Pete Becker

unread,
Aug 25, 2000, 3:00:00 AM8/25/00
to
Oliver A Ruebenacker wrote:
>
> When do I get floating point exceptions?
>

Be careful about terminology here -- it's tricky. A "floating point
exception" occurs when one of several things goes wrong in a floating
point computation. IEE-754 defines what these things are, and what
happens when they occur. The word "exception" in "floating point
exception" has nothing to do with the word "exception" as it is used in
the C++ language definition.

--
Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
Contributing Editor, C/C++ Users Journal (http://www.cuj.com)

E. Robert Tisdale

unread,
Aug 25, 2000, 3:00:00 AM8/25/00
to
Pete Becker wrote:

In my opinion, you need to say more.
The term "exception" is overloaded in several different contexts.
Computer manufacturers use an even narrower definition
than is found in the floating-point arithmetic standard.

There is no portable standard for floating-point exception handling
because there is no way to implement it on every platform
without a serious negative impact on performance.
That doesn't mean that a standard wouldn't be useful.
It just means that compilers might refuse to install standard
exception handlers on platforms that don't provide hardware
to detect the corresponding floating-point exception efficiently.


Xiaodong Huang

unread,
Aug 25, 2000, 3:00:00 AM8/25/00
to

"Oliver A Ruebenacker" <rueb...@lessing.oit.umass.edu> wrote in message
news:39a688e8$1...@oit.umass.edu...
> Hello!
>
> When do I get floating point exceptions?
>

You can get them for numerous reasons. My compiler's help
mentions the following:

Invalid Operation
Division by Zero
Overflow
Underflow
Inexact Result
Integer Overflow

Pete Becker

unread,
Aug 26, 2000, 3:00:00 AM8/26/00
to
Dar Keye wrote:

>
> E. Robert Tisdale (ed...@netwood.net) wrote:
> > Pete Becker wrote:
> >
> > > Oliver A Ruebenacker wrote:
> > > >
> > > > When do I get floating point exceptions?
> > > >
> > >
> > > Be careful about terminology here -- it's tricky. A "floating point
> > > exception" occurs when one of several things goes wrong in a floating
> > > point computation. IEE-754 defines what these things are, and what
> > > happens when they occur. The word "exception" in "floating point
> > > exception" has nothing to do with the word "exception" as it is used in
> > > the C++ language definition.
> > >
> > > --
> > > Pete Becker
> > > Dinkumware, Ltd. (http://www.dinkumware.com)
> > > Contributing Editor, C/C++ Users Journal (http://www.cuj.com)
> >
> > In my opinion, you need to say more.
> <chop>
>
> In my opinion, you are an asshole, and need to say less.

What he said was absolutely correct. Personal attacks are inappropriate.

Larry Brasfield

unread,
Aug 26, 2000, 3:00:00 AM8/26/00
to
In article <8o9rip$a00$1...@dosa.alt.net>, car...@daysinn.net says...

> Pete Becker (peteb...@acm.org) wrote:
> > Dar Keye wrote:
> > >
> > > E. Robert Tisdale (ed...@netwood.net) wrote:
[Thoroughly technical discussion, up to this point, cut.]

> > > In my opinion, you are an asshole, and need to say less.
> >
> > What he said was absolutely correct. Personal attacks are inappropriate.
> >
> >
> His statement of opinion is not a personal attack. And it is an opinion
> shared by many: Tisdale is an asshole.

The statement "you are an asshole" certainly qualifies
as a personal attack. It was also uncalled for in this
context and is inappropriate in this forum. This forum
is for discussion of C++ and closely related issues.

The injection by Mr. Keye of crude namecalling into a
heretofor sensible discussion is enough to earn him a
position in my killfile. For Mr. Carriage to condone
such rubbish earns him such honor as well.

<plonk> <plonk>.

--
Larry Brasfield
Above opinions may be mine alone.
(Humans may reply at unundered l.bras_field@computer.o_r_g )

Josh Sebastian

unread,
Aug 26, 2000, 10:02:16 PM8/26/00
to

> > > > In my opinion, you need to say more.
> > > <chop>
> > >
> > > In my opinion, you are an asshole, and need to say less.
> >
> > What he said was absolutely correct. Personal attacks are inappropriate.
> >
> >
> His statement of opinion is not a personal attack. And it is an opinion
> shared by many: Tisdale is an asshole.
>

That's off-topic.

________

"Yields falsehood when preceded by its quotation" yields falsehood when
preceded by its quotation.

Josh Sebastian
<cur...@earthlink.net>


Josh Sebastian

unread,
Aug 27, 2000, 3:00:00 AM8/27/00
to
"nullcyper" <clea...@syntax.net> wrote in message
news:8oaiki$bsp$1...@pita.alt.net...

> Josh Sebastian (cur...@earthlink.net) wrote:
> >
> > > > > > In my opinion, you need to say more.
> > > > > <chop>
> > > > >
> > > > > In my opinion, you are an asshole, and need to say less.
> > > >
> > > > What he said was absolutely correct. Personal attacks are
inappropriate.
> > > >
> > > >
> > > His statement of opinion is not a personal attack. And it is an
opinion
> > > shared by many: Tisdale is an asshole.
> > >
> >
> > That's off-topic.
> >
>
> You must be a Tisdale wannabe or a Tisdale lickspittle. Twit.

That was a joke. You obviously have no sense of humor.

E. Robert Tisdale

unread,
Aug 27, 2000, 3:00:00 AM8/27/00
to
Josh Sebastian wrote:

> "nullcyper" <clea...@syntax.net> wrote in message
> news:8oaiki$bsp$1...@pita.alt.net...
> > Josh Sebastian (cur...@earthlink.net) wrote:
> > >

> > > > > > > In my opinion, you need to say more.
> > > > > > <chop>
> > > > > >
> > > > > > In my opinion, you are an asshole, and need to say less.
> > > > >
> > > > > What he said was absolutely correct. Personal attacks are
> inappropriate.
> > > > >
> > > > >
> > > > His statement of opinion is not a personal attack. And it is an
> opinion
> > > > shared by many: Tisdale is an asshole.
> > > >
> > >
> > > That's off-topic.
> > >
> >

> > You must be a Tisdale wannabe or a Tisdale lickspittle. Twit.
>
> That was a joke. You obviously have no sense of humor.
>

> ________
>
> "Yields falsehood when preceded by its quotation" yields falsehood when
> preceded by its quotation.
>
> Josh Sebastian
> <cur...@earthlink.net>

Hi Josh,

Please don't respond to the trolls.

Thanks in advance, Bob Tisdale

0 new messages