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 #80267 is a reply to message #80266] Fri, 25 May 2012 06:07 Go to previous messageGo to previous message
Sir Loin Steak is currently offline  Sir Loin Steak
Messages: 42
Registered: January 2012
Member
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.
[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 18 13:47:36 PDT 2025

Total time taken to generate the page: 2.00032 seconds