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

Home » Public Forums » archive » Re: printing with a format in exponent!
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: printing with a format in exponent! [message #77995] Mon, 10 October 2011 21:06
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On 10/10/11 4:07 PM, Paulo Penteado wrote:
>
> http://www.idlcoyote.com/math_tips/sky_is_falling.html
>
>
> On Oct 10, 4:26 pm, Kim<adisn...@hotmail.com> wrote:
>> I'm quite confused why the formation option does not print as it
>> should.
>>
>> In the IDL terminal, I simply typed the following
>>
>> IDL> print, 1.58058980019603E+07, format='(E20.14)'
>>
>> However, it prints
>>
>> IDL> 1.580589800000E+07
>>
>> It is really important for the format to work because my calculation
>> goes up to 12th decimal point.
>>
>> Does anyone know why this is and how I can fix this problem?

To elaborate slightly, you'll need to be using double precision if you
need to be precise to the 12th decimal point:

IDL> print, 1.58058980019603e7, format='(E20.14)'
1.58058980000000E+07
IDL> print, 1.58058980019603d7, format='(E20.14)'
1.58058980019603E+07


Although be careful... just because you are using doubles, your
calculation may not preserve the maximum degree of machine precision.

-Jeremy.
Re: printing with a format in exponent! [message #78002 is a reply to message #77995] Mon, 10 October 2011 13:07 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
http://www.idlcoyote.com/math_tips/sky_is_falling.html


On Oct 10, 4:26 pm, Kim <adisn...@hotmail.com> wrote:
> I'm quite confused why the formation option does not print as it
> should.
>
> In the IDL terminal, I simply typed the following
>
> IDL> print, 1.58058980019603E+07, format='(E20.14)'
>
> However, it prints
>
> IDL> 1.580589800000E+07
>
> It is really important for the format to work because my calculation
> goes up to 12th decimal point.
>
> Does anyone know why this is and how I can fix this problem?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: positioning a TV image within plotting region
Next Topic: Writ 2 KML

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

Current Time: Fri Oct 10 08:15:05 PDT 2025

Total time taken to generate the page: 0.72224 seconds