2.1.3 Numeric Operators

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

Arithmetic
OperatorOperationOperand 1Operand 2Return
++incrementIntN/AInt
FloatN/AFloat
--decrementIntN/AInt
FloatN/AFloat
+additionFloatFloatFloat
FloatIntFloat
IntFloatFloat
IntIntInt
-subtractionFloatFloatFloat
FloatIntFloat
IntFloatFloat
IntIntInt
*multiplicationFloatFloatFloat
FloatIntFloat
IntFloatFloat
IntIntInt
/divisionFloatFloatFloat
FloatIntFloat
IntFloatFloat
IntIntFloat
%moduloFloatFloatFloat
FloatIntFloat
IntFloatFloat
IntIntInt
Comparison
OperatorOperationOperand 1Operand 2Return
==equalFloat/IntFloat/IntBool
!=not equalFloat/IntFloat/IntBool
<less thanFloat/IntFloat/IntBool
<=less than or equalFloat/IntFloat/IntBool
>greater thanFloat/IntFloat/IntBool
>=great than or equalFloat/IntFloat/IntBool
Bitwise
OperatorOperationOperand 1Operand 2Return
~bitwise negationIntN/AInt
&bitwise andIntIntInt
|bitwise orIntIntInt
^bitwise xorIntIntInt
<<shift leftIntIntInt
>>shift rightIntIntInt
>>>unsigned shift rightIntIntInt
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.