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 #56255 is a reply to message #56164] Tue, 09 October 2007 08:24 Go to previous messageGo to previous message
Maarten[1] is currently offline  Maarten[1]
Messages: 176
Registered: November 2005
Senior Member
On Oct 9, 3:11 pm, "edward.s.mei...@aero.org" <mei...@aero.org> wrote:
> On Oct 8, 9:18 am, wlandsman <wlands...@gmail.com> wrote:
>
>> Except that single precision or even a long integer (e.g. 2441636)
>> *could* be valid, if the user was not interested in fractional
>> days. I agree that it is probably safest to force the user to
>> input double precision, but this does not feel like the "IDL way".
>> Thanks, --Wayne
>
> Actually, it gets rounded:
>
> IDL> jd = 2441636.1
> IDL> print, jd, f='(f10.2)'
> 2441636.00
> IDL> jd = 2441636.9
> IDL> print, jd, f='(f10.2)'
> 2441637.00
>
> You're right, that is not a good thing. Mathematica has been doing it
> correctly for a long time, why can't IDL?

Well, we have
compile_opt defint32
what I want is
compile_opt defdouble
to have floating point constants on the command line and in code be in
double precision by default. If needed, one can use float() to
explicitly downcast a double, the other way round is impossible.

Best,

Maarten
[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: Fri Oct 10 02:32:51 PDT 2025

Total time taken to generate the page: 0.87892 seconds