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

Home » Public Forums » archive » 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
fractional powers of negative numbers? [message #8837] Thu, 24 April 1997 00:00 Go to previous message
Med Bennett is currently offline  Med Bennett
Messages: 109
Registered: April 1997
Senior Member
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
Previous Topic: IDL Homepage
Next Topic: C structure definition and IDL

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

Current Time: Sat Oct 11 08:15:55 PDT 2025

Total time taken to generate the page: 0.48191 seconds