Re: floating point precision on gcc-4 differs using variables or arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Asfand,

#1:  C does a lot of its calculations in double, or long double (depending on platform).

#2:  Intermediate results are often in long double.

#3:  Consider carefully if you should be using float, double, long double, integer or fixed point for your purposes.  The floating point numbers are finite precision.

If you are concerned about twiddly floating point number differences (which, otherwise, are to be EXPECTED)....

#4: Use -msoft-float to avoid twitchy hardware differences.  (I'm not sure if this is 100% IEEE 754 compliant; check the documentation.)  This will affect performance adversely.

Also...

As I recall, in the old days (pre-GCC 4.0), for many operations you'd have to explicitly use SSE instructions.  Still required the SSE flag to be explicitly given.  Hence, I believe Brian Budge's comments are valid and shouldn't be discounted out of hand.

#5: GCC 4.x has not been released yet.  Use with caveats.

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux