Skip to content

Instantly share code, notes, and snippets.

@andylshort
Created February 20, 2018 12:20
Show Gist options
  • Save andylshort/f60a3ee336f5fb658cd839187717ecab to your computer and use it in GitHub Desktop.
Save andylshort/f60a3ee336f5fb658cd839187717ecab to your computer and use it in GitHub Desktop.
Small function to determine if a type is a whole numeric whole or not
private static bool IsWholeNumericType(Type t)
{
var numericTypes = new[] {
typeof(Byte), typeof(Int16), typeof(Int32),
typeof(Int64), typeof(SByte), typeof(Single),
typeof(UInt16), typeof(UInt32), typeof(UInt64)
};
return numericTypes.Contains(t);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment