Rubyでの演算処理は、以下の優先順位に従って実行される。
優先順位:高
::
[]
+(単項), !, ~
**
-(単項)
*, /, %
+, -
<<, >>
&
|, ^
\>, >=, <, <=
<=>, ==, ===, !=, =~, !~
&&
||
.., ...
?:(条件演算子)
= (+=, -=, ...等も含む)
not
and, or
優先順位:低
Go to list of users who liked
More than 3 years have passed since last update.
Rubyでの演算処理は、以下の優先順位に従って実行される。
優先順位:高
::
[]
+(単項), !, ~
**
-(単項)
*, /, %
+, -
<<, >>
&
|, ^
\>, >=, <, <=
<=>, ==, ===, !=, =~, !~
&&
||
.., ...
?:(条件演算子)
= (+=, -=, ...等も含む)
not
and, or
優先順位:低
Register as a new user and use Qiita more conveniently
Go to list of users who liked