internal static bool IsFloatingPoint(Type type) { type = GetNonNullableType(type); switch (Type.GetTypeCode(type)) { case TypeCode.Single: case TypeCode.Double: return true; default: return false; } }