Quantcast
Channel: PTC Community: Message List
Viewing all articles
Browse latest Browse all 11979

Re: return or not return? Is it a bug? Explanation needed!

$
0
0

Mathcad sees the entire expression, including the boolean comparison, as "the program". So in the second case the return causes the program to exit before the boolean comparison occurs, and the returned value is a+b, because that's what is fed to the return statement.

 

Why not just make the last line "return (a+b)=3" ?


Viewing all articles
Browse latest Browse all 11979

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>