com.akiban.sql.types.TypeId.typePrecedence()
Each built-in type in JSQL has a precedence. This precedence determines how to do type promotion when using binary operators. For example, float has a higher precedence than int, so when adding an int to a float, the result type is float. The precedence for some types is arbitrary. For example, it doesn't matter what the precedence of the boolean type is, since it can't be mixed with other types. But the precedence for the number types is critical. The SQL standard requires that exact numeric types be promoted to approximate numeric when one operator uses both. Also, the precedence is arranged so that one will not lose precision when promoting a type. NOTE: char, varchar, and longvarchar must appear at the bottom of the hierarchy, but above USER_PRECEDENCE, since we allow the implicit conversion of those types to any other built-in system type.
@return The precedence of this type.