ShortExtensions

Static Class in Zigurous.Math

Declaration

public static class ShortExtensions

Description

Extension methods for short integers.

Extension Methods

HasFlagChecks if a given flag is set in the bitmask. (mask & flag) == flag
HasAnyFlagChecks if any of the given flags are set in the bitmask. (mask & flags) != 0
IsEvenChecks if the number is even. n % 2 == 0
IsOddChecks if the number is odd. n % 2 != 0
IsZeroChecks if the number is zero. n == 0
IsPositiveChecks if the number is positive. n > 0
IsNegativeChecks if the number is negative. n < 0
ToBinaryStringConverts the number to a string of binary digits.