Bug in 21, 25 - y raised to the x



#2

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


#3

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


#4

Hi,

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

Raymond


#5

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

#6

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 ...

#7

Just checked it.

Regards,
Harry


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP-25 Wayne Selway 1 1,237 11-22-2013, 12:58 PM
Last Post: Michael de Estrada
  HP 21 - How to troubleshoot? Adam Vaughn 13 3,527 10-02-2013, 09:40 AM
Last Post: Adam Vaughn
  HP-25 aj04062 13 3,681 03-30-2012, 03:23 AM
Last Post: Russell Dobson
  HP-35A/21 D.MS<-->Decimal degrees routines Matt Agajanian 9 2,885 03-29-2012, 11:03 AM
Last Post: Matt Agajanian
  21, 45, 32E--which should be next? Matt Agajanian 14 3,670 03-25-2012, 02:48 AM
Last Post: Thomas Radtke
  If the 21 came after the 45...? Matt Agajanian 5 1,891 03-24-2012, 05:45 PM
Last Post: Matt Agajanian
  HP-21 displays all zeroes Barry Smith 5 1,940 01-27-2012, 01:22 PM
Last Post: Steve Simpkin
  HP-25 robertoataulfo 4 1,579 07-25-2011, 02:12 PM
Last Post: robertoataulfo
  HP 25c Apps Review: GO 25 SCI, rpn 25 Eddie W. Shore 14 3,829 03-29-2011, 05:10 PM
Last Post: Andrés C. Rodríguez (Argentina)
  New -21 and -25 apps for iPhone Eric Smith 14 3,690 03-12-2011, 05:39 PM
Last Post: Eddie W. Shore

Forum Jump: