Created
February 20, 2018 12:20
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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