The Museum of HP Calculators

HP Forum Archive 09

[ Return to Index | Top of Index ]

Bug in 21, 25 - y raised to the x
Message #1 Posted by Don Davis on 18 Dec 2002, 4:44 p.m.

I came across an interesting bug when playing around with an HP-21 I recently acquired. If I try to square a negative number using the "y raised to the x" key, I get an error message. The same is true on the HP-25 I tried, although using the x^2 key works fine.

I am sure this is probably well-known to HP enthusiasts in this group, but I did not find documentation of it when I searched. Does anyone know more about this bug - i.e., when it was corrected? My 34C handles the calculation just fine. I think the 29C does also, although I cannot verify that at the moment.

best regards, Don

      
Re: Bug in 21, 25 - y raised to the x
Message #2 Posted by Ernie Malaga on 18 Dec 2002, 5:05 p.m.,
in response to message #1 by Don Davis

Don:

This "bug" is present in the oldest HP calculators. I suppose it's due to the fact that powers were calculated by way of logarithms, and you can't apply the LN function to a negative number. More modern calculators circumvent this problem by analyzing both numbers, and work the sign of the result based on that. If I'm not mistaken, the HP-67/97 were the first calculators to be able to raise negative numbers to whole powers.

By the same token, the oldest machines allowed you to CHS the number zero, and I think I read somewhere that the HP-35 gave an error message if you tried to calculate the square root of -0. More modern calculators don't change the sign of zero no matter how many times you press CHS.

Ain't life innerestin'?

-Ernie

            
Re: Bug in 21, 25 - y raised to the x
Message #3 Posted by Raymond Hellstern (Germany) on 18 Dec 2002, 6:04 p.m.,
in response to message #2 by Ernie Malaga

Hi,

I think the low end TI's still can't calculate powers with negative exponents...

Raymond

                  
Re: Bug in 21, 25 - y raised to the x
Message #4 Posted by Michel Beaulieu on 18 Dec 2002, 8:37 p.m.,
in response to message #3 by Raymond Hellstern (Germany)

no, it's with negative base they have problems... :-)

      
I would not call it a bug...
Message #5 Posted by Andrés C. Rodríguez (Argentina) on 20 Dec 2002, 5:44 p.m.,
in response to message #1 by Don Davis

Certinly y^x was calculated using logarythms, and negative base was not allowed. I think it was around the HP67 time when the internal routines were improved to accept integer powers for negative bases. It was a nice improvement but not more than a sophistication handled before (with no complaints) by the users ...

      
It works fine on the 29C
Message #6 Posted by Harry (Germany) on 24 Dec 2002, 8:36 p.m.,
in response to message #1 by Don Davis

Just checked it.

Regards, Harry


[ Return to Index | Top of Index ]

Go back to the main exhibit hall