Help with a Program - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: Help with a Program (/thread-16042.html) |
Help with a Program - WrongWay - 12-11-2020 10:01 PM I have a program tossing a DATA ERROR on the v41 software halting on line 62. I'm trying to run a stack trace to see why it's failing. Any help is appreciated. Code:
RE: Help with a Program - Joe Horn - 12-11-2020 10:06 PM I suspect that line 62 is trying to raise a negative number to a fractional power, which the 41 cannot do, but says "DATA ERROR" instead. It would help us if you gave us a hint about the program's purpose and inputs. RE: Help with a Program - WrongWay - 12-12-2020 01:24 AM I think I found my error, i got lost in my flow chart and forgot to actually finish the program RE: Help with a Program - WrongWay - 12-12-2020 04:13 AM I think I found an error in an equation. But im not sure how to implement this equation in rpn efficiently with 4 stacks. T is a variable and the c_* arguments are constants. (c0+T*(c1+T*(c2+T*(c3+T*(c4+T*(c5+T*(c6+T*(c7+T*(c8+T*(c9)))))))))) any help is greatly appreciated RE: Help with a Program - Craig Bladow - 12-12-2020 05:43 AM Assuming T is present in the X register, your program could fill the stack with T using a series of ENTER commands. Then the program basically works from C9 to C0 doing something like this in RPN for each constant: C9 * C8 + * C7 + * ....... This takes advantage of the stack duplicating the value in the T register when an operation, * in this case, causes the stack to drop. |