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 #80265] Fri, 25 May 2012 07:02 Go to previous message
Carsten Lechte is currently offline  Carsten Lechte
Messages: 124
Registered: August 2006
Senior Member
On 25/05/12 15:07, Sir Loin Steak wrote:

> 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.

If you want to save a number in full precision (e.g. when saving the
state of some numerical code), simply increasing the number of
significant digits is wasteful and does not work for numbers that are
not representable in the decimal system.

You can look at binary formats, like HDF5 (look for routines starting
with H5_ in the idl help).

If you want to stay within the more universally readable ascii realm,
ANSI C defines a formatting code "%a" that writes an exact
representation of the floating point number, using hex for the
mantissa and decimal for the exponent. Unfortunately, IDL 6.4's
printf-style format codes do not implement this.

If you just want a little more precision, use the format code as you
mentioned.


chl
[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: Fri Oct 10 22:07:09 PDT 2025

Total time taken to generate the page: 0.08453 seconds