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

Home » Public Forums » archive » format codes
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: format codes [message #93679 is a reply to message #93677] Wed, 28 September 2016 08:00 Go to previous messageGo to previous message
Jim  Pendleton is currently offline  Jim Pendleton
Messages: 165
Registered: November 2011
Senior Member
On Wednesday, September 28, 2016 at 5:44:57 AM UTC-6, Craig Markwardt wrote:
> On Tuesday, September 27, 2016 at 10:49:42 AM UTC-4, sayani ghosh wrote:
>> I am working with with phase data that looks like 23568978.124578 in cycles.
>> I want to export the whole value in decimal format without rounding off. The problem while using E11.4 or a or G10.4 is, IDL is rounding my data like 2.3568e+007.. Which is leading to errors in consequent calculations.
>
> FORMAT='(G)'
>
> will print the full double precision and include the exponent where necessary.

For those reading this thread in the future with IDL 8.6 or later, be aware of the difference between "(G)" (FORTRAN-style) and "%g" (C_style) FORMAT specifiers because they are not equivalent.

IDL> print, a, format = '(G)'
1.234567891011112E-066
IDL> print, a, format = '%g'
1.23457e-066
IDL> print, a, format = '%22g'
1.234567891011112e-066

Jim P.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to read nc variable partly?
Next Topic: high rise building extraction from satellite image

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

Current Time: Wed Oct 08 11:35:30 PDT 2025

Total time taken to generate the page: 0.00402 seconds