這不是我的家庭作業 - 我只是在練習。我似乎無法圍繞這個斷言概念進行思考。C++ preconditions /斷言
1) Determine the pre-condition for x that guarantees the post-condition about y
{ _______ }
if (x > 0)
y = x;
else
y = -x;
{ y >= 0 && |y| == |x| }
2) This code is the same as has been seen before, but the post-condition is different.
Describe why this post-condition is better for verifying the code than just { y >= 0}.