Boolean And - one question
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!?
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!?
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:
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.