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

Home » Public Forums » archive » Re: fractional powers of negative numbers?
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: fractional powers of negative numbers? [message #8810 is a reply to message #8809] Mon, 28 April 1997 00:00 Go to previous messageGo to previous message
Jack Saba is currently offline  Jack Saba
Messages: 30
Registered: January 1996
Member
IDL is computing -(5.^1.51) in your example. If you try (-5.)^1.51, you
will get an error.


Med Bennett wrote:
>
> Can someone explain this to me? Is it possible to compute the fractional
> power of a negative number? IDL does it on single negative values but
> not on arrays containing negative values.
>
> IDL> print,findgen(11)-5
> -5.00000 -4.00000 -3.00000 -2.00000
> -1.00000 0.000000 1.00000 2.00000
> 3.00000 4.00000 5.00000
> IDL> print,(findgen(11)-5)^1.51
> -1.#IND0 -1.#IND0 -1.#IND0 -1.#IND0
> -1.#IND0 0.000000 1.00000 2.84810
> 5.25355 8.11168 11.3617
> % Program caused arithmetic error: Floating illegal operand
> IDL> print,-2.^1.51
> -2.84810
> IDL> print,-5.^1.51
> -11.3617
>
> Med Bennett
> bennettm@boulder.pti-enviro.com
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: IDL, Mathematica, Matlab
Next Topic: Fractals, Kalman-Filter and IDL

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

Current Time: Wed Oct 08 19:20:11 PDT 2025

Total time taken to generate the page: 0.00427 seconds