private static string GetNumericSubtype(IConvertible convValue) { string subtype = null; if (convValue is decimal) { subtype = "decimal"; } else if (convValue.IsFloatingPoint()) { subtype = "floating-point"; } else if (convValue.IsUnsignedIntegral()) { subtype = "unsigned-integer"; } else if (convValue.IsSignedIntegral()) { subtype = "signed-integer"; } return(subtype); }
/// <summary> /// Determines whether the specified value is one of the simple types defined by C# to /// contained unsigned integer values but is not a <c>char</c>. /// </summary> /// <para> /// This method returns true for a value of any of <c>byte</c>, <c>uint</c>, <c>ulong</c>, /// and <c>ushort</c>. /// </para> /// <param name="value"></param> /// <returns></returns> public static bool IsUnsignedIntegralAndNotChar(this IConvertible value) { return(!(value is char) && value.IsUnsignedIntegral()); }
private static string GetNumericSubtype(IConvertible convValue) { string subtype = null; if (convValue is decimal) { subtype = "decimal"; } else if (convValue.IsFloatingPoint()) { subtype = "floating-point"; } else if (convValue.IsUnsignedIntegral()) { subtype = "unsigned-integer"; } else if (convValue.IsSignedIntegral()) { subtype = "signed-integer"; } return subtype; }