Please login or register.

Login with username, password and session length
gfx gfx
1617 Posts in 535 Topics by 779 Members - Latest Member: December 05, 2022, 02:07:05 PM
gfx* Home | Help | Search | Login | Register | gfx
Absoft User Forum  |  Support  |  General  |  Precision preservation

Author Topic: Precision preservation  (Read 3646 times)


  • Newbie
  • *
  • Posts: 4
Precision preservation
« on: February 02, 2011, 07:08:22 PM »
I need to read in many large data sets from input files derived from various sources. The values in the files are not in standard double precsion format (i.e. 1.0D0), but I am using them in calculations that require double precision accuracy. What is the best way to handle this? I currently read the values into double precision variables, but if the behavior is the same as assigning constants which are not specified as double precision within the code, then I am not maintaining the precision I want. What happens if I read the values into single precision variables and then explicitly convert them to double precision using REAL and selected_real_kind(15)? Or is my only choice to preprocess all the input into double precision format?

Thanks for your help!


  • Administrator
  • Sr. Member
  • *****
  • Posts: 333
Re: Precision preservation
« Reply #1 on: February 04, 2011, 05:53:35 AM »
As long as you READ the data into double precision variables, the precision will be preserved regardless of the character (E, D or Q) used to designate the exponent.

Note that is different from stating constants in your source code where the exponent specifier is respected.

Absoft User Forum  |  Support  |  General  |  Precision preservation

gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!