17 using System.Globalization;
20 using System.Runtime.CompilerServices;
60 throw new NotImplementedException();
68 [MethodImpl(MethodImplOptions.AggressiveInlining)]
71 if (typeof(T) == typeof(
double))
73 return (T)Convert.ChangeType(
double.NaN, typeof(T), CultureInfo.InvariantCulture);
75 else if (typeof(T) == typeof(decimal))
77 return (T)Convert.ChangeType(decimal.Zero, typeof(T), CultureInfo.InvariantCulture);
85 [MethodImpl(MethodImplOptions.AggressiveInlining)]
86 public static bool IsNone(
object value) =>
IsNone(value?.GetType(), value);
91 [MethodImpl(MethodImplOptions.AggressiveInlining)]
92 public static bool IsNone(Type type,
object value)
94 if (type ==
null || value ==
null)
98 else if(type == typeof(
double))
100 return ((
double)value).IsNaNOrInfinity();
102 else if (type == typeof(decimal))
104 return default(decimal) == (decimal)value;
106 else if (type == typeof(DateTime))
108 return default(DateTime) == (DateTime)value;