currentPrice
から100
... _
int price = currentPrice > 100 ? currentPrice : 100
int price = Math.Max(currentPrice, 100)
currentPrice
この質問を提起したのは、他のスレッドが変数を編集できるコンテキストについて考えていたからです。
最初のケースでは...price
よりも低い値を取得でき100
ますか?
私は次のことを考えています:
if (currentPrice > 100) {
//currentPrice is edited here.
price = currentPrice;
}