The current set of arithmetic data types includes seven elements:
HxScalarInt, HxScalarDouble, HxComplex, HxVec2Int, HxVec2Double, HxVec3Int, and HxVec3Double.
Each element can be constructed in one of the following ways: (i) without parameters (value is undefined), (ii) from another value of the same type, or (iii) from a specific number of corresponding native data types (HxScalarInt: 1 int, HxScalarDouble: 1 double, HxComplex: 2 double's, HxVec2Int: 2 int's, HxVec2Double: 2 double's, HxVec3Int: 3 int's, HxVec3Double: 3 double's). A data type can also be casted to each of the other six data types as shown in the table. No other construction/conversion paths will be defined to avoid ambiguities in expressions.
The table shows conversions between arithmetic data types. An element in the table shows the result of casting the value in the leftmost column (on the same row) to the value on the top row (in the same column). d(i) is the normal promotion of int
to double
as defined in C++. i(d) is the normal conversion of double
to int
.