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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: double precision? [message #49694] Fri, 11 August 2006 13:17 Go to next message
Chris[2] is currently offline  Chris[2]
Messages: 39
Registered: August 2003
Member
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
>
Re: double precision? [message #49697 is a reply to message #49694] Fri, 11 August 2006 12:15 Go to previous messageGo to next message
adisn123 is currently offline  adisn123
Messages: 44
Registered: July 2006
Member
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
Re: double precision? [message #49716 is a reply to message #49697] Thu, 10 August 2006 13:35 Go to previous messageGo to next message
news.qwest.net is currently offline  news.qwest.net
Messages: 137
Registered: September 2005
Senior Member
<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
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
>>
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 15:26:53 PDT 2025

Total time taken to generate the page: 0.00765 seconds