comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: double precision?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: double precision? [message #49782 is a reply to message #49694] Mon, 14 August 2006 09:45 Go to previous message
adisn123 is currently offline  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
>>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: slow processing of my k-nearest neighour code
Next Topic: Postscript and Object Graphics, special characters

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 17:31:15 PDT 2025

Total time taken to generate the page: 1.04100 seconds