system/src/sc/lang/java/ModelUtil.java
public static Object coerceNumberTypes(Object lhsType, Object rhsType) {
      // If we are coercing Integer, Float, etc. and Number the base is a Number
      if (isNumber(lhsType))
         return lhsType;

      if (isNumber(rhsType))
         return rhsType;

      if (lhsType == rhsType)
           return lhsType;

      if (isDouble(lhsType))
           return lhsType;

      if (isDouble(rhsType))
           return rhsType;

      if (isFloat(lhsType))
           return lhsType;

      if (isFloat(rhsType))
           return rhsType;

      if (isLong(lhsType))
           return lhsType;

      if (isLong(rhsType))
           return rhsType;

      if (isInteger(lhsType))
           return lhsType;

      if (isInteger(rhsType))
           return rhsType;

      if (isShort(lhsType))
           return lhsType;

      if (isShort(rhsType))
           return rhsType;

      return rhsType;
   }
// TODO: Performance Fix - me - should be looking up a precedence value in each type and just comparing them
Performance Fix - me - should be looking up a precedence value in each type and just comparing them
Performance Fix - me - should be looking up a precedence value in each type and just comparing them
public static Object coerceNumberTypes(Object lhsType, Object rhsType) {
      if (isNumber(lhsType))
         return lhsType;
      if (isNumber(rhsType))
         return rhsType;
      if (lhsType == rhsType)
           return lhsType;
      if (isDouble(lhsType))
           return lhsType;
      if (isDouble(rhsType))
           return rhsType;
      if (isFloat(lhsType))
           return lhsType;
      if (isFloat(rhsType))
           return rhsType;
      if (isLong(lhsType))
           return lhsType;
      if (isLong(rhsType))
           return rhsType;
      if (isInteger(lhsType))
           return lhsType;
      if (isInteger(rhsType))
           return rhsType;
      if (isShort(lhsType))
           return lhsType;
      if (isShort(rhsType))
           return rhsType;
      return rhsType;
   }
public static Object coerceNumberTypes ( Object lhsType , Object rhsType ) { if ( isNumber ( lhsType ) ) return lhsType ; if ( isNumber ( rhsType ) ) return rhsType ; if ( lhsType == rhsType ) return lhsType ; if ( isDouble ( lhsType ) ) return lhsType ; if ( isDouble ( rhsType ) ) return rhsType ; if ( isFloat ( lhsType ) ) return lhsType ; if ( isFloat ( rhsType ) ) return rhsType ; if ( isLong ( lhsType ) ) return lhsType ; if ( isLong ( rhsType ) ) return rhsType ; if ( isInteger ( lhsType ) ) return lhsType ; if ( isInteger ( rhsType ) ) return rhsType ; if ( isShort ( lhsType ) ) return lhsType ; if ( isShort ( rhsType ) ) return rhsType ; return rhsType ; }
TODO: Performance Fix - me - should be looking up a precedence value in each type and just comparing them
TODO : Performance Fix - me - should be looking up a precedence value in each type and just comparing them
// If we are coercing Integer, Float, etc. and Number the base is a Number