SCIENTIFIC-LINUX-USERS Archives

March 2013

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Matthias Schroeder <[log in to unmask]>
Reply To:
Matthias Schroeder <[log in to unmask]>
Date:
Fri, 15 Mar 2013 17:21:53 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (23 lines)
Hi,

On 03/15/2013 04:59 PM, Keith Lofstrom wrote:
> ...  Are double and float synonyms for the same
> double precision representation?

 From http://en.wikipedia.org/wiki/C_data_types:

"The actual size of floating point types also varies by implementation. 
The only guarantee is that the long double is not smaller than double, 
which is not smaller than float. Usually, 32-bit and 64-bit IEEE 754 
floating point formats are used, if supported by hardware."

The other issue could be that most calculations might be done using 
register values with precision far exceeding the precision of the 
variable in memory. That would complete 'hide' the expected effect of 
the float or double on the calculations. Use -ffloat-store to avoid this 
for your tests.

HTH,

Matthias

ATOM RSS1 RSS2