KS6023
べき乗の前にあるマイナス記号。 べき乗が先に計算されるため、-2 ** 2 は -(2 ** 2)、つまり -4 になります。数学や Python と同じ扱いです。4 と読む人も多いため、括弧で意図を明示してください:
<let name="loss" value="-(2 ** 2)" /> <!-- -4 because the brackets square 2 first -->
<let name="square" value="(-2) ** 2" /> <!-- 4 because the brackets square -2 -->$loss = -(2 ** 2) // -4 because the brackets square 2 first
$square = (-2) ** 2 // 4 because the brackets square -2括弧を付ける修正は2つあります。-(2 ** 2) と書くと現在の値が保たれ、(-2) ** 2 と書くと負の数が使われます。-($side ** 2) のように累乗全体を括弧で囲む書き方はすでに分かりやすいため、警告の対象にはなりません。