[Programming] Condition problem
[Programming] Condition problem
(OP)
Hi again,
The enclosed program selects the most appropriate pipe stub from a standard. Although the program works, it returns bad results.
For specified dimensions of pipe, it doesnt find the anticipated result and iterates till it runs out of arguments.
The condition d.2oprz+2*δ.2oprz=(boolean eq.)=d.zkróćca[k*mm for specified dimensions should be fulfilled at 11th iteration, but the loop does not exits.
Can any one help?
The enclosed program selects the most appropriate pipe stub from a standard. Although the program works, it returns bad results.
For specified dimensions of pipe, it doesnt find the anticipated result and iterates till it runs out of arguments.
The condition d.2oprz+2*δ.2oprz=(boolean eq.)=d.zkróćca[k*mm for specified dimensions should be fulfilled at 11th iteration, but the loop does not exits.
Can any one help?
RE: [Programming] Condition problem
Any decimal value you enter is stored as a binary floating point number per IEEE standard. Therefore, unless you are using only integers, it would be exceeding unlikely to get an exact match for two seemingly identical decimal values. If you do the actual math, you'll see that the values differ by 2.776E-17 mm.
Read "Lookup Functions" in the help files for how Mathcad does it for its internal lookup functions. You need to determine a tolerance and program accordingly.
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
Chinese prisoner wins Nobel Peace Prize
RE: [Programming] Condition problem
Your sarcasm is unnecessary, even if my knowleadge is bad.
RE: [Programming] Condition problem
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
Chinese prisoner wins Nobel Peace Prize
RE: [Programming] Condition problem