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 #51104 is a reply to message #51101] Mon, 30 October 2006 10:22 Go to previous messageGo to previous message
Braedley is currently offline  Braedley
Messages: 57
Registered: September 2006
Member
edward.s.meinel@aero.org wrote:
> 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

Just out of curiosity, has anyone tried this on Matlab? I'd expect the
same (or similar) results, but it'd be interesting if they weren't.

Braedley
[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: Fri Oct 10 22:03:55 PDT 2025

Total time taken to generate the page: 1.51886 seconds