[CAS:HP-PPL] Total control of flags to successfully run a program - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: [CAS:HP-PPL] Total control of flags to successfully run a program (/thread-7291.html) |
[CAS:HP-PPL] Total control of flags to successfully run a program - compsystems - 11-22-2016 09:56 PM Hello, the following code fails if the "increasing" flag is set The evolution of the HP-PPL is going in a right way, but this should improve. The handling of expression with PART cmd is affected by the cas flags, for this reason I should be able to source code to set them Expr -> 9 * x ^ 2 + 8 * x (increasing off) Part (expr, 1) -> 9 * x ^ 2 Expr -> 8 * x + 9 * x ^ 2 (increasing on) Part (expr, 1) -> 8 * x I can not tell the user to prefix manually n flags before running the program, the control of flag must be automatic and by commands, with the currently HP-PPL, I can not determine the status of some flags and the programs return incorrect answers My recommendation is to complete the support of the flag shown in CAS settings ... quadraticFormulaStepByStep source code https://en.wikipedia.org/wiki/Quadratic_formula PHP Code: export exprout; // only test Think if the output of the program previous, would be observed in pretty-print Other problems with the previous code History view (b^2-4*a*c)/(4*a^2); [enter] -> (b^2-4*a*c)/(4*a^2) // ok // part 1 -> b^2-4*a*c , part 2 -> 4*a^2 part(Ans,1); [enter] -> b^2-4*a*c // ok ----------------------------------- (b^2-4*a*c)/(4*a^2); [enter] -> (b^2-4*a*c)/(4*a^2) // ok part(Ans,2); [enter] -> 1/(4*a^2) // Why? I expected 4*a^2, Does not agree with the show history view, with the calculated: part(Ans,1); [enter] -> 4*a^2 Why? The above expression says 1/(4*a^2), // part 1 -> 1 part 2 -> 4*a^2 ----------------------------------- (b^2-4*a*c)/(4*a^2); [enter] -> (b^2-4*a*c)/(4*a^2) // ok part(Ans,2); [enter] -> 1/(4*a^2) // part 1 -> 1 , part 2 -> 4*a^2 part(Ans,2); [enter] -> "Error: Bad Argument Value" |