0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

真偽・比較_「すごいErlangゆかいに学ぼう!」_#04

Last updated at Posted at 2018-11-04

and or。trueはtrueのみ。nullはない。

true and false. %% => false
false or true. %% => true
true xor false. %% => true
not false. %% => true
not (true and true). %% => false

両側評価が基本

true or 1/0. %% => error 両側評価
true orelse 1/0. %% => true 片側評価(短絡評価)
true andalso "fuga" %% => "fuga"。短絡評価は右側がbooleanじゃなくても良い。でも右辺にfalseをもってくると当然、falseが返される

比較

5 == 5.0. %% true
5 =:= 5.0. %% false。型も評価
5 =:= 5. %% true
5 /= 6. %% true。スラッシュは否定の意味
10 =/= 10.0. %% true

等号、不等号

1 < 2. %% true
3 > 1. %% true
3 >= 1. %% true
4 =< 5. %% true。向きが他の言語ではないパターン。口をへの字に結んだ人の顔として覚えれば良い

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?