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

Home » Public Forums » archive » Re: Reads Precision Error?
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: Reads Precision Error? [message #3670] Mon, 06 March 1995 09:38
chase is currently offline  chase
Messages: 62
Registered: May 1993
Member
>>>> > "Christopher" == Christopher McCarthy <chris@sfsu.edu> writes:
In article <3jbsjr$29f@news.csus.edu> chris@sfsu.edu (Christopher McCarthy) writes:


Christopher> three = [0.123456789012345d0,1.d0,1.d0]
Christopher> a = 1.d0 & b = 1.d0 & c=1.d0 ;initalize double
Christopher> reads,three,a,b,c
Christopher> print,three(0),a,f='(D40.30)'

Christopher> And you get:

Christopher> 0.123456789012344997358283649191
Christopher> 0.123456789999999996809698643574

three is not a string. READS takes a string for the first argument
(like the corresponding FORTRAN statement). The "IDL Reference Guide"
states that if the "supplied argument is not a string, it is
automatically converted." It probably does the conversion the same
way as the STRING command (I believe it uses the default list-directed
formats explained in the User Guide chapter on I/O).

To see what conversion result do this:
s=strarr(3)
reads,three,s
print,s
0.12345679 1.0000000 1.0000000

The commands below should give you what you expect:

three=['0.123456789012345d0','1.d0','1.d0'] ; string argument
a = 1.d0 & b = 1.d0 & c=1.d0 ;initalize double
reads,three,a,b,c
print,a,f='(D40.30)'
0.123456789012344990000000000000


Chris
--
===============================
Bldg 24-E188
The Applied Physics Laboratory
The Johns Hopkins University
Laurel, MD 20723-6099
(301)953-6000 x8529
chris.chase@jhuapl.edu
[Message index]
 
Read Message
Previous Topic: Cursor Keys don't work for PV-WAVE CL v5.0 on DEC ALPHA OSF/1 v3.0
Next Topic: IDL vrs. PV-Wave as Gui Builders

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

Current Time: Sun Oct 12 11:17:58 PDT 2025

Total time taken to generate the page: 1.67810 seconds