LongExtensions
Static Class in Zigurous.Math
Declaration
public static class LongExtensions
Description
Extension methods for long integers.
Extension Methods
GetBits | Returns a subset of bits from the number. |
HasFlag | Checks if a given flag is set in the bitmask. (mask & flag) == flag |
HasAnyFlag | Checks if any of the given flags are set in the bitmask. (mask & flags) != 0 |
IsEven | Checks if the number is even. n % 2 == 0 |
IsOdd | Checks if the number is odd. n % 2 != 0 |
IsZero | Checks if the number is zero. n == 0 |
IsPositive | Checks if the number is positive. n > 0 |
IsNegative | Checks if the number is negative. n < 0 |
ToBinaryString | Converts the number to a string of binary digits. |