Re: double precision? [message #49782 is a reply to message #49694] |
Mon, 14 August 2006 09:45  |
adisn123
Messages: 44 Registered: July 2006
|
Member |
|
|
Thanks it's working.
Chris Torrence wrote:
> You still need the "d" after the number, to make sure it is double
> precision:
>
> IDL> a = 1.24500000476837d
>
> IDL> print,a,format='(f25.16)'
>
> 1.2450000047683700
>
> -Chris
>
>
>
> <adisn123@yahoo.com> wrote in message
> news:1155323735.947393.276430@m73g2000cwd.googlegroups.com.. .
>> I tried your way, but IDL prints
>>
>> IDL> a = 1.24500000476837
>> IDL> print,a,format='(f50.25)'
>> 1.2450000047683715820312500
>> IDL>
>>
>> Furthermore, the variable a is constantly used throughout the whole
>> program.
>> Is there a way that all the other calculation use the same a and makes
>> output in the same
>> decimal points?
>>
>>
>>
>> R.G. Stockwell wrote:
>>> <adisn123@yahoo.com> wrote in message
>>> news:1155241088.452911.315540@i3g2000cwc.googlegroups.com...
>>>> Hi,
>>>>
>>>> The value that I want to keep in a variable, a, is
>>>> 1.24500000476837.
>>>> After I define as
>>>> IDL> a = 1.24500000476837
>>>> then, print, a
>>>> IDL> print, a
>>>> IDL> 1.2450000
>>>> so, I tried
>>>> IDL> a = 1.24500000476837d ;; to make it as a double precision, but
>>>> IDL prints
>>>> IDL> help, a
>>>> A DOUBLE = 1.2450000
>>>> IDL> print, a
>>>> 1.2450000
>>>>
>>>>
>>>> How can I keep all those decimal points?
>>>> I thought double precision can express up to 14 decimal places of
>>>> significant points?
>>>
>>>
>>> Try
>>> IDL> print,a,format='(f50.25)'
>>> 1.2450000047683700000000000
>>>
>>> Cheers,
>>> bob
>>
|
|
|