Golang

Operators

Arithmetic Operators

SymbolOperationValid Types
+Sumintegers, floats, complex values, strings
-Differenceintegers, floats, complex values
*Productintegers, floats, complex values
/Quotientintegers, floats, complex values
%Remainderintegers
&Bitwise ANDintegers
`integersBitwise OR
^Bitwise XORintegers
&^Bit clear (AND NOT)integers
<<Left shiftinteger << unsigned integer
>>Right shiftinteger >> unsigned integer

Comparison Operators

SymbolOperation
==Equal
!=Not equal
<Less
<=Less or equal
>Greater
>=Greater or equal

Logical Operators

SymbolOperation
&&Conditional AND
`Conditional OR
!NOT

On this page