演算子

このヘルプでは、COBOL、C#、VB.NET での演算子の使い方について説明します。

COBOL の演算子

Comparison
= < > <= >= <>
 
Arithmetic
+ - * /
function mod
*>no direct COBOL equivalent to integer division
**
 
Assignment
move, set, compute
 
Bitwise
b-and, b-or, b-xor, b-not, b-left, b-right
 
Logical
and, or, not

C# の演算子

Comparison
==  <  >  <=  >=  !=
 
Arithmetic
+  -  *  /
%  (mod)
/  (integer division if both operands are ints)
Math.Pow(x, y)
 
Assignment
=  +=  -=  *=  /=   %=  &=  |=  ^=  <<=  >>=  ++  --
 
Bitwise
&   |   ^   ~   <<   >>
 
Logical
&&   ||   &   |   ^   !
 
//Note: && and || perform short-circuit logical evaluations
 
String Concatenation
+

VB.NET の演算子

Comparison
=  <  >  <=  >=  <>
 
Arithmetic
+  -  *  /
Mod
\  (integer division)
^  (raise to a power)
 
Assignment
=  +=  -=  *=  /=  \=  ^=  <<=  >>=  &=
 
Bitwise
And   Or   Xor   Not   <<   >>
 
Logical
AndAlso   OrElse   And   Or   Xor   Not
 
'Note: AndAlso and OrElse perform short-circuit logical evaluations
 
String Concatenation
& 

これらの例の一部は、ハーディング大学コンピュータ サイエンス学部の Frank McCown 博士が作成したもので、クリエイティブ コモンズ ライセンスに基づいて使用が許可されています。