On 01.11.2009 03:22, George Neuner wrote: > On Sat, 31 Oct 2009 13:51:58 +0100, Robert Klemme > <shortcutter / googlemail.com> wrote: > >> On 10/31/2009 07:35 AM, George Neuner wrote: >> >>> It's also worth noting that most floating point hardware is not >>> anywhere close to 754 compliant even though most FPUs do use the >>> standard number formats (at least for single and double precision). >> Interesting! I wasn't aware of that. Why is that? Do they just leave >> out operations or are HW vendors actually cutting corners and digressing >>from the prescribed algorithms / results? > > Actually the primary reason for deviating from the standard is to > achieve better performance. The standard algorithms are designed to > correctly handle a lot of corner cases that most users will never > encounter in practice. Many manufacturers have chosen to make > expected normal use as fast as possible at the expense of handling the > corner cases incorrectly. > > Many CPUs do not implement all the standard rounding modes. Some use > projective affinity where the standard specifies affine infinity > (makes a difference whether +inf == -inf) and most do not support > gradual denormalization (underflow) but simply pin the result to zero > when underflow occurs. > > What confuses people is that most CPUs now use (at least) IEEE-754 > single and double precision bit formats ... because of that many > people conclude erroneously that the CPU is performing math according > to the 754 standard. George, thanks for the elaborate and interesting explanation! Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/