types (conflict) [message #36842] |
Sat, 01 November 2003 04:13 |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Dear all
only for information
I recognized a lot of people don't know that there is a difference in coding
of double numbers.
a=[10.0D,20.0D,9999.9D]
print,a,format='(F20.10)
10.0000000000
20.0000000000
9999.9000000000
Each number has to get the "D" sign in the definition, this is important.
Sometimes I see routines only first number is signed by "D" then the array
is in double but not all values are definied by the right precision.
a=[10.0D,20.0,9999.9]
print,a,format='(F20.10)
10.0000000000
20.0000000000
9999.9003906250
The same with Make_Array,
b=make_array(value=9999.9D,3,/double)
print,b,format='(F20.10)
9999.9000000000
9999.9000000000
9999.9000000000
If the "D" sign is missing:
b=make_array(value=9999.9,3,/double)
print,b,format='(F20.10)
9999.9003906250
9999.9003906250
9999.9003906250
regards
Reimar
--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
|
|
|