# HP Forums

Full Version: Solve App and ABS() and IP()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I have two equations.
E1: S=(IP(X/L)*IP(Y/M)+IP(X/M)*IP(Y/L)+ABS(IP(X/L)*IP(Y/M)-IP(X/M)*IP(Y/L)))*0.5

E2:C=IP(X/L)*IP(Y/(2*M-2) )+IP(X/(2*M-2))*IP(Y/L)+ABS(IP(X/L)*IP(Y/(2*M-2))-IP(X/(2*M-2))*IP(Y/L))

When I solve them one by one, the answer is correct:
[attachment=2679]
[attachment=2680]

But, if I solve them at the same time, the answer of E2 is not correct.
[attachment=2681]

Is it a bug?
[attachment=2684]
21-10-2015 attachment updated

Updated on 22-10-2015
I modify the equations to as follows. They have the same problem.
E1:C=IP(X/(2*M-2))*IP(Y/L)*2
E2:B=A

If solve E1 and E2 at the same time, the answer or E1 is not correct.
Replace every instance of IP() with hIP() where hIP() is defined:

Code:
```EXPORT hIP(x) BEGIN  return IP(x); END;```

You will then get the correct answer. I believe your problem is because sometimes the calculator is deciding to use CAS to calculate the integer part. The program forces the calculator to use HOME for that calculation.

That should work in your other post with a similar issue but I haven't tried it.

Hi,

It works, amazing.

Thank you very much!
Hello,

In Solve app,
When solving a single equation, Prime uses a numerical Zero finder (inherited from the HP48 and previous calculators).
When solving multiple equations, it uses the CAS.

This has 2 side effects:
1) the CAS is not great at dealing with discontinuities in solving (Discontinuities are very hard!)
2) Cas version of the functions are used, nor numerical ones. As a general rules, this is not a problem as they yield identical results. But this is only a general rules as some edge cases for lesser used function might differ.

Cyrille
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :