The Museum of HP Calculators

HP Forum Archive 08

 Programming challenge (HP 12C)Message #1 Posted by mapet on 28 Mar 2002, 3:08 a.m. Write the shortest (measured by steps not keystokes) program for 3 root...Platform: HP 12C

 Re: Programming challenge (HP 12C)Message #2 Posted by Frank Glitz on 28 Mar 2002, 4:15 a.m.,in response to message #1 by mapet Is it allowed to use y^x? :-) Or the LN / e^x functions? :-) Or should algorithms avoiding these functions be used? :-( How large is your solution (if you have one yet...)?

 Re: Programming challenge (HP 12C)Message #3 Posted by mapet on 28 Mar 2002, 5:20 a.m.,in response to message #2 by Frank Glitz My solution is 4 steps long, but it seems that you've already guessed it ... :-) BTW y^x makes it 5 steps long. I have to work on more difficult challenge next time...

 Re: Programming challenge (HP 12C)Message #4 Posted by Frank Glitz on 28 Mar 2002, 5:52 a.m.,in response to message #3 by mapet > I have to work on more difficult challenge next time... Not really! Just don't allow the usage of these functions of the 12C. That's a little harder nut to crack (for someone whose math courses are long-forgotten, like me ;-) Someone remembers how to do?

 Re: Programming challenge (HP 12C) - May I?Message #5 Posted by Vieira, Luiz C. (Brazil) on 28 Mar 2002, 8:39 a.m.,in response to message #1 by mapet Hello; I did not get to the point (Sorry!). What is 3 root?

 Re: Programming challenge (HP 12C)Message #6 Posted by thibaut.be on 28 Mar 2002, 12:01 p.m.,in response to message #1 by mapet I guess this is you solution : y = e^((ln x)/3) so the steps are : 01 43 23 g e^x 02 3 3 03 10 / 04 43 22 g LN Note how it is easy in a HP to calculate a apperently more complicated formula...

 Re: Programming challenge (HP 12C)Message #7 Posted by John Ioannidis on 28 Mar 2002, 8:44 p.m.,in response to message #1 by mapet Why is this even a challenge? [3] [1/x] [y^x] three steps, three keystrokes.

Go back to the main exhibit hall