|Re: HP 42s square/nth root|
Message #11 Posted by Karl Schneider on 1 Feb 2004, 3:41 p.m.,
in response to message #10 by Andrés C. Rodríguez (Argentina)
Andres, Robin --
Good, informative discussion. I think we're all on the same page, and have it right. I learned a couple things myself, regarding the enhancements of early units and why one of the complex-valued roots of (-8)^(1/3) is considered the "primary" root. (The other root, of course, is the complex conjugate of the primary.)
Robin is right that taking the negatvie-integer root of the absolute value of the argument, then negating the answer, is the workaround. In fact, this is what I suspect is the basis of the algorithm on improved later HP's for integer exponents of negative numbers:
For x > 0.00 (floating-point) and n an integer,
(-x)^n = exp[n*ln(x)]*[(-1)^n] (change sign of result if n is odd)
Of course, this applies only if n is an integer.
Now, if y = 0 in y^x, x must be positive -- Negative x yields divide by 0, and x = 0 yields undefined 0^0 -- READERS: Please don't launch that thread again!.
Makes one appreciate what a complete implementation of mathematical functionality entails, doesn't it?
Edited: 1 Feb 2004, 3:49 p.m.