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

Home » Public Forums » archive » Re: Type of array to store large numbers
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: Type of array to store large numbers [message #80266 is a reply to message #80265] Fri, 25 May 2012 06:36 Go to previous messageGo to previous message
Russell Ryan is currently offline  Russell Ryan
Messages: 122
Registered: May 2012
Senior Member
On May 25, 9:07 am, Sir Loin Steak <lj...@fsmail.net> wrote:
> On May 25, 1:58 pm, Fab <fabien.mauss...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>> On 05/25/2012 02:50 PM, Sir Loin Steak wrote:
>
>>> Hi all
>
>>> I have a lot of numbers that have high precision (such as 401.4798584)
>>> and I am trying to find what sort of array to use to store these
>>> values. Can anyone help? I've tried floats, doubles etc, and none keep
>>> the precision to more than 5 d.p. Am I missing something obvious, or
>>> is what I'm after impossible?!!
>
>> What do you mean with "keep" the precision?
>
>> IDL> f = 401.4798584
>> IDL> d = 401.4798584d
>> IDL> print, f
>>        401.480
>> IDL> print, d
>>         401.47986
>> IDL> print, f, FORMAT='(F12.8)'
>> 401.47985840
>> IDL> print, d, FORMAT='(F12.8)'
>> 401.47985840
>
>> http://www.idlcoyote.com/math_tips/sky_is_falling.html
>
>> Cheers
>
> Sorry, what I meant was I want to write the data to a file for another
> program to read, but the data were always output in the form 401.480.
> I never thought about specifying with a format statement! I'll give it
> a go now.
>
> Thanks for the help.

I think you missed the point of the previous post. When you declare
something as a double, IDL keeps that precision but doesn't print it
out when you say print. You need to use a formatted print statement
to "see" all those extra digits.

The bottom line is, they're there. You just aren't seeing them. And
do read that article by Fanning.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Type of array to store large numbers
Next Topic: Pan/Zoom Line Plots with Coyote Graphics

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

Current Time: Sat Oct 11 10:25:15 PDT 2025

Total time taken to generate the page: 1.75947 seconds