Re: Grumbling about setting double precision [message #78775 is a reply to message #78774] |
Wed, 21 December 2011 06:20   |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article < 31663559.520.1324400314865.JavaMail.geo-discussion-forums@yq dj19 >,
wlandsman <wlandsman@gmail.com> wrote:
> I am converting a Python program to IDL which includes several hundred double
> precision data values. In Python the data values are written as follows:
>
> a = [2721.64363164731, -1615.73035059635]
>
> As described by David Fanning in
> http://www.idlcoyote.com/math_tips/double.html to make these double precision
> in IDL, it is not enough to convert the vector to double
>
> IDL> print,double(a),f='(2f18.10)'
> 2721.6435546875 -1615.7303466797
>
> and it is not enough to put a "d" at the end of one of the values
>
> IDL> a = [2721.64363164731d, -1615.73035059635]
> IDL> print,double(a),f='(2f18.10)'
> 2721.6436316473 -1615.7303466797
>
> Instead, I must spend an hour in my editor putting a "d" at the end of every
> single data value.
>
> But it would sure be nice to be able to somehow tell the IDL compiler to
> interpret numeric values as double precision. --Wayne
You could replace "," with "D," and replace "]" with "D]".
That should only take a minute or two with find and replace.
Ken
|
|
|