Re: C2124 is most disrespectful of IEEE floating point arithmetic
- From: "Dr Pizza" <DrPizza@xxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Aug 2006 13:02:28 -0700
Abdo Haji-Ali wrote:
"Dr Pizza" <DrPizza@xxxxxxxxxxxxxxxxx> wrote in messageIt's not a book as such, but IEC 559 clearly states that 1.0 / 0.0 is
news:xn0eqk4re2h581y00a@xxxxxxxxxxxxxxxxxxxxxxx
Erm, if that is your interpretation then that part of the standardGive me the name of the book that says 1.0/0.0 is defined under any
has no meaning. There is not one single "mathematics". For
example, the mathematics of integers has different properties from
the mathematics of reals (consider how for example things like
division behave differently with integers as compared to reals).
There are a number of peculiarities to the mathematics used for
various types; the arithmetics for the three kinds basic numeric
types (signed integers, unsigned integers, floating point) are all
different.
"mathmatics"...
defined to be +inf. And IEC 559 governs this situation because
is_iec559 is true for both float and double.
It's undefined in every math scienceIn real arithmetic there's no inexactness of representation either.
In pure math, 1.0/0.0 is undefined. However, 1.0/n when n tends to
0.0 (n != 0.0) is infinity
Nor is there any concept of overflow or underflow. Reals are dense
unlike floats which are not. In floats, the identity x = x does not
hold true; it does for reals. Yet you accept these peculiar properties
of floats without question.
The mathematics of reals is irrelevant, because floating point numbers
are not real numbers. Floating point numbers are an approximation to
real numbers, and that approximation has different numerical
properties. And those properties are the ones laid out in IEC 559.
IEEE is not a math science, it can't define what isn't defined inIEC 559 is not merely a representation. It also describes the
math, nor it can put any math rules. IEEE is simply a representation
of float numbers in digital systems
behaviour, as I've already quoted elsewhere in the thread. IEC 559
defines what occurs when a floating point division by zero is performed.
The compiler ships with the library, and Microsoft bundle them allIt is unreasonable to use any system of mathematics when evaluatingis_iec559 is simply a flag that tells you how the CPU is treating the
these expressions other than the one defined by IEC 559, just as it
is unreasonable to use any system other than modulo integer
arithmetic when considering unsigned integral expressions, or an
appropriate signed arithmetic when considering signed integral
expressions.
type. It's not a flag from the compiler but from the C++ library. You
can't blame the compiler for its value
together; VC++ is a hosted environment. If the library is lying (i.e.
does not properly describe the environment) then MS's implementation is
faulty. The library and the compiler go together; if you maintain that
the compiler is correct then the library is incorrect and there is
still a problem.
--
.
- Follow-Ups:
- Re: C2124 is most disrespectful of IEEE floating point arithmetic
- From: Tom Widmer [VC++ MVP]
- Re: C2124 is most disrespectful of IEEE floating point arithmetic
- References:
- C2124 is most disrespectful of IEEE floating point arithmetic
- From: Dr Pizza
- Re: C2124 is most disrespectful of IEEE floating point arithmetic
- From: Doug Harrison [MVP]
- Re: C2124 is most disrespectful of IEEE floating point arithmetic
- From: Dr Pizza
- Re: C2124 is most disrespectful of IEEE floating point arithmetic
- From: Alexander Grigoriev
- Re: C2124 is most disrespectful of IEEE floating point arithmetic
- From: Dr Pizza
- Re: C2124 is most disrespectful of IEEE floating point arithmetic
- From: Abdo Haji-Ali
- Re: C2124 is most disrespectful of IEEE floating point arithmetic
- From: Dr Pizza
- Re: C2124 is most disrespectful of IEEE floating point arithmetic
- From: Abdo Haji-Ali
- C2124 is most disrespectful of IEEE floating point arithmetic
- Prev by Date: Re: Annoying, frustrating, timewasting LNK2019 ERROR - PLS HELP!!
- Next by Date: Runtime error trying to open a file in a sttatic .lib
- Previous by thread: Re: C2124 is most disrespectful of IEEE floating point arithmetic
- Next by thread: Re: C2124 is most disrespectful of IEEE floating point arithmetic
- Index(es):
Relevant Pages
|