Boolean And - one question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!?
Solved! Go to Solution.
- Labels:
-
Other
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
