Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Is it an Error or one property of Mathcad (as in BASIC or Pascal, not C)?
If 2>3=0 why we must check one more second operand!?
Solved! Go to Solution.
Hi Valery,
Mathcad doesn't appear to implement lazy evaluation(*), except in specific instances (such as the boolean operators). Your function And is a standard function, so Mathcad evaluates both arguments of your function And before calling it.
I suspect that the 3<i comparison might be picked up as a static type incompatibility, ie it's done at compile time rather that during execution, which is why Mathcad doesn't seem to follow the boolean non-evaluation rule.
However, I do agree that it would be good to implement lazy evaluation and some form of memoization..
Stuart
Note:
Hi Valery,
Mathcad doesn't appear to implement lazy evaluation(*), except in specific instances (such as the boolean operators). Your function And is a standard function, so Mathcad evaluates both arguments of your function And before calling it.
I suspect that the 3<i comparison might be picked up as a static type incompatibility, ie it's done at compile time rather that during execution, which is why Mathcad doesn't seem to follow the boolean non-evaluation rule.
However, I do agree that it would be good to implement lazy evaluation and some form of memoization..
Stuart
Note:
Thanks, Stuart!
I must do so - see the picture and one IAPWS web-sheet
http://twt.mpei.ac.ru/MCS/Worksheets/iapws/IAPWS-IF97-Region3-VPT.xmcd