DHUIntExtensions extension

DHUIntExtensions

on

Properties

absolute int

Available on int, provided by the DHUIntExtensions extension

Returns the absolute value
no setter
doubled int

Available on int, provided by the DHUIntExtensions extension

Return this number time two
no setter
quadrupled int

Available on int, provided by the DHUIntExtensions extension

Return this number time four
no setter
squared int

Available on int, provided by the DHUIntExtensions extension

Return squared number
no setter
tripled int

Available on int, provided by the DHUIntExtensions extension

Return this number time three
no setter

Methods

bitCount() int

Available on int, provided by the DHUIntExtensions extension

Returns the number of set bits in this integer's binary representation.
factorial() int

Available on int, provided by the DHUIntExtensions extension

Returns the factorial of this integer.
gcd(int other) int

Available on int, provided by the DHUIntExtensions extension

Returns the greatest common divisor of this integer and other.
inRangeOf(int min, int max) int

Available on int, provided by the DHUIntExtensions extension

Return the min if this number is smaller then minimum Return the max if this number is bigger the the maximum Return this number if it's between the range
isDivisibleBy(int divisor) bool

Available on int, provided by the DHUIntExtensions extension

Checks if this integer is divisible by divisor.
isFibonacci() bool

Available on int, provided by the DHUIntExtensions extension

Checks if this integer is a Fibonacci number.
isPerfectCube() bool

Available on int, provided by the DHUIntExtensions extension

Checks if this integer is a perfect cube.
isPerfectSquare() bool

Available on int, provided by the DHUIntExtensions extension

Checks if this integer is a perfect square.
isPowerOf(int base) bool

Available on int, provided by the DHUIntExtensions extension

Checks if this integer is a power of base.
isPrime() bool

Available on int, provided by the DHUIntExtensions extension

Checks if this integer is a prime number.
lcm(int other) int

Available on int, provided by the DHUIntExtensions extension

Returns the least common multiple of this integer and other.
primeFactors() List<int>

Available on int, provided by the DHUIntExtensions extension

Returns the prime factors of this integer.
toBinaryString() String

Available on int, provided by the DHUIntExtensions extension

Converts this integer to a binary string.
toHexString() String

Available on int, provided by the DHUIntExtensions extension

Converts this integer to a hexadecimal string.