format codes [message #93669] |
Tue, 27 September 2016 07:49  |
sayaniforever
Messages: 2 Registered: September 2016
|
Junior Member |
|
|
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.
|
|
|
|
|
|
|
|
Re: format codes [message #93679 is a reply to message #93677] |
Wed, 28 September 2016 08:00   |
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.
|
|
|
Re: format codes [message #93680 is a reply to message #93679] |
Wed, 28 September 2016 08:22   |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
Interesting. I seem not to be able to travel forward in time... When is 8.6 appearing for non-time travelers?
Any further sneak preview info (apart from the c_style output formatting)?
Thanks,
h
On Wednesday, September 28, 2016 at 5:00:20 PM UTC+2, Jim P wrote:
> 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.
|
|
|
Re: format codes [message #93682 is a reply to message #93680] |
Wed, 28 September 2016 11:17   |
Jim Pendleton
Messages: 165 Registered: November 2011
|
Senior Member |
|
|
On Wednesday, September 28, 2016 at 9:22:08 AM UTC-6, Helder wrote:
> Interesting. I seem not to be able to travel forward in time... When is 8.6 appearing for non-time travelers?
> Any further sneak preview info (apart from the c_style output formatting)?
>
> Thanks,
> h
>
>
>
> On Wednesday, September 28, 2016 at 5:00:20 PM UTC+2, Jim P wrote:
>> 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.
Info on a few new features in 8.6 has been leaking out over the past months over on the IDL Data Point blog on the www.harrisgeospatial.com website. The time frame for release is still in the works as of September 28, 2016.
|
|
|
Re: format codes [message #93694 is a reply to message #93669] |
Sat, 01 October 2016 22:34  |
sg26041991
Messages: 3 Registered: July 2016
|
Junior Member |
|
|
I have tried entering the data as string input and reading them as double precision values. It's working that way..
Thanks a lot everybody for your suggestions.
|
|
|