This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Floating point performance issue


On 2011-12-26 12:56:50 +0100, David Brown wrote:
> No, integer arithmetic is well-defined and consistent.

No, with integer arithmetic you can have overflows, which are not
specified and where things can badly fail, just like the Ariane 5
explosion:

  http://www.ima.umn.edu/~arnold/disasters/ariane.html

If you try to implement calculations on real numbers in integer
arithmetic instead of floating-point, you will have the same kinds
of problems (if you want to compare 2 approximations, the equality
operator won't work either), except that you will need to handle
more difficulties manually.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]