# 2.1.3 Numeric Operators

This the list of numeric operators in Haxe, grouped by descending priority.

##### Unary
OperatorOperationOperand 1Operand 2Return
`~`bitwise negation`Int`N/A`Int`
`+`plus`Float/Int`N/A`Float/Int`
`-`minus`Float/Int`N/A`Float/Int`
`++`increment`Float/Int`N/A`Float/Int`
`--`decrement`Float/Int`N/A`Float/Int`
##### Arithmetic
OperatorOperationOperand 1Operand 2Return
`%`modulo`Float/Int``Float/Int``Float/Int`
OperatorOperationOperand 1Operand 2Return
`*`multiplication`Float/Int``Float/Int``Float/Int`
`/`division`Float/Int``Float/Int``Float`
OperatorOperationOperand 1Operand 2Return
`+`addition`Float/Int``Float/Int``Float/Int`
`-`subtraction`Float/Int``Float/Int``Float/Int`

About `Float/Int` return type: If one of the operands is of type `Float`, the resulting expression will also be of type `Float`, otherwise the type will be `Int`.

##### Bitwise
OperatorOperationOperand 1Operand 2Return
`<<`shift left`Int``Int``Int`
`>>`shift right`Int``Int``Int`
`>>>`unsigned shift right`Int``Int``Int`
OperatorOperationOperand 1Operand 2Return
`&`bitwise and`Int``Int``Int`
`|`bitwise or`Int``Int``Int`
`^`bitwise xor`Int``Int``Int`
##### Comparison
OperatorOperationOperand 1Operand 2Return
`==`equal`Float/Int``Float/Int``Bool`
`!=`not equal`Float/Int``Float/Int``Bool`
`<`less than`Float/Int``Float/Int``Bool`
`<=`less than or equal`Float/Int``Float/Int``Bool`
`>`greater than`Float/Int``Float/Int``Bool`
`>=`great than or equal`Float/Int``Float/Int``Bool`
##### Equality

For enums:

• Enum without parameters Are always represent the same value, so `MyEnum.A == MyEnum.A`.
• Enum with parameters Can be compared with `a.equals(b)` (which is a short for `Type.enumEquals()`).

Dynamic: Comparison involving at least one Dynamic value is unspecifed and platform-specific.

##### Differences with other languages

Haxe precedence differ from other languages for the following cases:

• `%` have lower precedence than `*` and `/` whereas in C these three have the same
• `|`, `&` and `^` have the same precedence in Haxe, so they will be always grouped from left-to-right, whereas in C `&` have lower precedence than `^` which itself have lower precedence than `|`
• `|`, `&` and `^` also have lower precedence than `==` and `!=` in Haxe