Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
数値が 100 以上 200 未満かどうかを確認する必要があります。
100 =< x < 200 の場合
Luaの適切な構文は何ですか?
これは正しい構文です。
if x >= 100 and x < 200 then -- your code end
ほとんどのプログラミング言語 (Python は顕著な例外) は連鎖比較演算子をサポートしておらず、明示的に 2 回比較し、比較の結果を論理 andで結合する必要があることを覚えておいてください。
また、 「以上」=<についても書きました。ほとんどすべてのプログラミング言語では、「より大きい/小さい」演算子の前に比較文字が付きます。例: , .<=>=
=<
<=
>=