lkml.org 
[lkml]   [2004]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Somewhat OT: gcc, x86, -ffast-math, and Linux
Date

On 26 mar 2004, at 21:54, Daniel Forrest wrote:

> different machines. However, the differences are all less than the
> precision of a single-precision floating point number. By this I mean
> that if the results (which are written to 15 digits of precision) are
> only compared to 7 digits then the results are the same. Also, most
> of the time the 15 digit values are the same.
>

(sorry if this is stupid, but anyways...)

Don't blame fast-math, if I undestood what you did...
With single-precission floats, you just have 7 digits of precission
(scientific notation) [1].
If you ask printf() to write 15 decimal places, it just _lies_.
How does it invent the rest of decimals, is up to glibc. Just
get glibc sources.

In short, anything past the 7th digit is crap, and can be different
depending on the box, cosmic rays and a butterfly waving its wings.

[1] cpp -dM /dev/null | grep EPSILON
cpp -dM /dev/null | grep FLT


--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
MacOS X 10.3.3, Build 7F44, Darwin Kernel Version 7.3.0

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.045 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site