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

Home » Public Forums » archive » Re: Grumbling about setting double 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: Grumbling about setting double precision [message #78765 is a reply to message #78763] Wed, 21 December 2011 08:16 Go to previous messageGo to previous message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
Ok, a simple assignment would have to be converted to float (unless specified with the D) to retain the usual IDL behaviour:

a=24.5 {internally a=float(24.5d) }

but

b=[24.5d,9999.9] would then work as expected, since the assigned values (which are apparently copied into the dblarr after being read somewhere else) would already be doubles. In this case, the array type comes from the first element as usual (float unless specified otherwise), so

c=[24.5,9999.9] should likewise produce a satisfactory float array.



The other example from your page,

array = Make_Array(3, Value=9999.9, /Double)

is a tricky one. Normally you would use

array = Make_Array(3, Value=9999.9d)

to make a dblarr() with a specific value, which is fine (and /double for a zeroed array). Here, you're specifically converting the float to a double - I think there's no harm to leave that effect as it is.

Wouldn't that work?

cheers,
Greg
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: running IDL as a 'sleeping' process
Next Topic: Affordable SEO Services

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

Current Time: Wed Oct 08 15:26:33 PDT 2025

Total time taken to generate the page: 0.00477 seconds