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

Home » Public Forums » archive » Recognizing 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: Recognizing double precision? [message #56241 is a reply to message #56164] Wed, 10 October 2007 07:07 Go to previous messageGo to previous message
edward.s.meinel@aero. is currently offline  edward.s.meinel@aero.
Messages: 52
Registered: February 2005
Member
On Oct 9, 11:50 am, "R.G. Stockwell" <noem...@please.com> wrote:
> "wlandsman" <wlands...@gmail.com> wrote in message
>
> news:1191597160.614557.153160@50g2000hsm.googlegroups.com...
>
>> About once a year I receive a complaint about my code because someone
>> inputs a Julian date like this
>
>> IDL> jd = 2441636.1
>
> btw, this may be obvious to all, but you can force the input
> with a read command, read it as string, and cast it to double.
>
> IDL> .GO
>
> : 2441636.1
>
> S STRING = ' 2441636.1'
>
> 2441636.1
>
> single:
>
> 2441636.00000
>
> double
>
> 2441636.10000
>
> Cheers,
> bob

Sure, you _could_ do that, but that is even worse than

IDL>jd = 2441636.1d

The point is that IDL should be smart enough to cast the variable into
the correct type automatically. After all, it works for integers:

y = 1
INT

y = 123456
LONG

y = 12345678901234
LONG64

Ed
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: large info structure?
Next Topic: Read data from SQL data base?

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

Current Time: Sat Oct 11 21:59:49 PDT 2025

Total time taken to generate the page: 1.35903 seconds