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

Home » Public Forums » archive » Re: Math Question
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: Math Question [message #51110 is a reply to message #51109] Mon, 30 October 2006 07:19 Go to previous messageGo to previous message
edward.s.meinel@aero. is currently offline  edward.s.meinel@aero.
Messages: 52
Registered: February 2005
Member
Rob wrote:
> In general, powers of negative numbers are complex so you should start
> with that assumption in the expression:
>
> IDL> print,(dcomplex(-1.0,0.0))^2.01
> ( 0.99950656, 0.031410729)
> IDL> print,(dcomplex(-1.0,0.0))^2.0
> ( 1.0000000, -2.4492127e-016)
>
> It would be nice if IDL told you this rather than throwing a NaN at
> you.

Actually, to be consistent, IDL should just return a complex number.
One of the reasons that I've been using IDL is that it automatically
changes the variable TYPE when necessary so that I don't have to keep
track of whether I'm operating on a BYTE, LONG, DOUBLE, whatever... Now
I find out that it's "mostly" true (but who can refuse a nice mutton
sandwich?).

I would consider this a bug.

Ed "to blave" Meinel
[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
Read Message
Read Message
Read Message
Previous Topic: Re: Determining a safe variable name from a string
Next Topic: overlaying arrow plots

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

Current Time: Sat Oct 11 05:04:01 PDT 2025

Total time taken to generate the page: 2.30689 seconds