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

Home » Public Forums » archive » Re: Set Precision???????????
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: Set Precision??????????? [message #15787 is a reply to message #15786] Mon, 14 June 1999 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Anil Kochhar wrote:
> I'd like create a varible which always holds numbers out to 6 places
> passed the decimal point, and 4 numbers before the decimal point (e.g.
> 1999.123456). I tried double
> precision but this seems to only hold 8 digits total for decimal numbers.
> However I would like to create a variable corresonding to a fraction of a
> Year (e.g 1995.123456). I have not been able to find a procedure allowing
> me to create 10 digit decimal number , without the number being rounded
> off to 8 digits.
> Does anyone know of a way to declare a variable to hold a 10 digit
> decimal number?

I think you are confusing internal machine precision with print
formatting precision. For example, to print the double precision PI
system variable:

IDL> print, !dpi
3.1415927
IDL> print, !dpi, format='(e20.10)'
3.1415926536e+00

The default print format only prints 8 digits, but you can change the
print format to print more digits. On machines with IEEE arithmetic, 64
bit double precision stores about 15 digits of information. For a nice
discussion of how floating point numbers are represented, see 'Section 4
- Floating-point numbers' at

http://metalab.unc.edu/pub/languages/fortran/unfp.html

Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
[Message index]
 
Read Message
Read Message
Previous Topic: Re: POLYWARP question.
Next Topic: device, true_color=24, decompose=0

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

Current Time: Fri Oct 10 23:18:51 PDT 2025

Total time taken to generate the page: 1.12187 seconds