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

Home » Public Forums » archive » Double Accuracy
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Double Accuracy [message #29679] Mon, 11 March 2002 10:46 Go to previous message
michaeltcruz is currently offline  michaeltcruz
Messages: 4
Registered: March 2002
Junior Member
I am in the process of writing a program to read in exponential data
and plot its relationship to another variable. The trouble I am
having is that the values I am reading in are very small and I am
losing accuracy when I convert from a STRING to DOUBLE. Below is the
procedure I am using with a sample of the input and output. As you
can see, the output for this RATIO value is truncated to eight digits
which makes the value useless. I am fairly new to PVWAVE so I could
be making some fundamental mistakes. Appreciate help anyone can give.


PRO read_scc, file, VTCW, DOY, Year, Time, Ratio

Dummy = STRARR(4)
TempRatio = DOUBLE(1.0)

status = DC_READ_FIXED(file, Dummy, $
Format = "(7X, A33)", Nskip = 1)

VTCW = float(Dummy(0))
Year = STRMID(Dummy(1), 1, 4)
DOY = fix(STRMID(Dummy(1), 6, 3))
Time = float(STRMID(Dummy(1), 10, 33))
Ratio = Dummy(2)
print, 'BRatio', Ratio
Ratio = STRSUBST(Ratio, 'e', 'd');
print, 'ARatio', Ratio
Ratio = DOUBLE(Ratio)
info, Ratio

END

INPUT FILE

xxx ZZZZZ 02 022 07:29:11
VTCW = 5.447425871924000e+13
UTC = 2002 022 2.583419472210000e+04
RATIO = 9.999198181040011e-07


OUTPUT

;BRatio 9.999198181040011e-07
;ARatio 9.999198181040011d-07
RATIO DOUBLE = 9.9991982e-07
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: color table question
Next Topic: Re: Visual C++ compiler option for >1GB of memory

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

Current Time: Thu Oct 09 22:46:34 PDT 2025

Total time taken to generate the page: 0.24109 seconds