IntExtensions

final class IntExtensions(val thisInt: Int) extends AnyVal

Extension methods for Int.

class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def %%(divisor: Int): Int

More useful definition of modulus where a negative number divided by a positive divisor produces a non negative modulus.

More useful definition of modulus where a negative number divided by a positive divisor produces a non negative modulus.

def *(operator: Length): Length

Extension methods multiplies this scalar Int by the operand in metres

Extension methods multiplies this scalar Int by the operand in metres

Base32 string representation of this Int.

Base32 string representation of this Int.

multiplies this Int by a billion and returns the result as Long.

multiplies this Int by a billion and returns the result as Long.

def commaInts(otherInts: Int*): String

Takes this Int as a value in arc degrees and converts it to a value of radians.

Takes this Int as a value in arc degrees and converts it to a value of radians.

Takes this Int as a value in arc degrees and converts it to a value of arc seconds.

Takes this Int as a value in arc degrees and converts it to a value of arc seconds.

def diff(operand: Int): Int
def div2: Int

Divides this Int by 2.

Divides this Int by 2.

def div4: Int

Divides this Int by 4.

Divides this Int by 4.

Dividing by 4 gives remainder of 0.

Dividing by 4 gives remainder of 0.

Dividing by 4 gives remainder of 2.

Dividing by 4 gives remainder of 2.

def divRoundUp(operand: Int): Int

Divides rounding up. 11.divRoundUp(10) == 2;

Divides rounding up. 11.divRoundUp(10) == 2;

def doTimes(f: () => Unit): Unit
def foldTo[A](toValue: Int, initialValue: A)(f: (A, Int) => A): A

folds across the Integer range starting with this Int to the given end of range.

folds across the Integer range starting with this Int to the given end of range.

def foldUntil[A](untilValue: Int, initialValue: A)(f: (A, Int) => A): A

folds across the Integer range starting with this Int until the given end of range.

folds across the Integer range starting with this Int until the given end of range.

Returns this Int value in Length or millions of kilometres.

Returns this Int value in Length or millions of kilometres.

def hundredthsStr(hundreds: Int): String
def if0Else[A](vZero: => A, vNonZero: => A): A

Returns the first lazily evaluated parameter if this Int is 0 else returns the second lazily evaluated parameter.

Returns the first lazily evaluated parameter if this Int is 0 else returns the second lazily evaluated parameter.

def ifEvenElse[A](vEven: => A, vOdd: => A): A

Returns the first lazily evaluated parameter if this Int is even else returns the second lazily evaluated parameter.

Returns the first lazily evaluated parameter if this Int is even else returns the second lazily evaluated parameter.

def ifMod(predicate: Boolean, f: Int => Int): Int

if the predicate is true apply the function to this Int, else return thisInt unmodified.

if the predicate is true apply the function to this Int, else return thisInt unmodified.

def ifOddElse[A](vOdd: => A, vEven: => A): A

Returns the first lazily evaluated parameter if this Int is odd else returns the second lazily evaluated parameter.

Returns the first lazily evaluated parameter if this Int is odd else returns the second lazily evaluated parameter.

def ifSumEven[A](evenVal: => A, oddVal: => A, operand: Int): A
def ifSumOdd[A](oddVal: => A, evenVal: => A, operand: Int): A

Returns true if this Int is even, false if this Int is odd.

Returns true if this Int is even, false if this Int is odd.

Returns true if this Int is even, false if this Int is odd.

Returns true if this Int is even, false if this Int is odd.

Returns this Int value in Length kilometres.

Returns this Int value in Length kilometres.

Returns this Int value in Length millions of miles.

Returns this Int value in Length millions of miles.

def max0: Int

Returns the value or 0, if this Int less than 0.

Returns the value or 0, if this Int less than 0.

Returns this Int value in Length.

Returns this Int value in Length.

Returns this Int value in Length.

Returns this Int value in Length.

multiplies this Int by a million and returns the result as Int.

multiplies this Int by a million and returns the result as Int.

def min0: Int

Returns the value or 0, if this Int more than 0.

Returns the value or 0, if this Int more than 0.

def power(operand: Int): Int

Only use positive value that won't overflow int)

Only use positive value that won't overflow int)

multiplies this Int by a quadrillion and returns the result as Long.

multiplies this Int by a quadrillion and returns the result as Long.

Takes this Int as a value in radians and converts it to a value of arc degrees.

Takes this Int as a value in radians and converts it to a value of arc degrees.

Takes this Int as a value in radians and converts it to a value of arc seconds.

Takes this Int as a value in radians and converts it to a value of arc seconds.

Decrements the value of an integer while that integer does not match condition. Not guaranteed to terminate.

Decrements the value of an integer while that integer does not match condition. Not guaranteed to terminate.

Returns this Int's value if even, else returns thisInt - 1.

Returns this Int's value if even, else returns thisInt - 1.

Returns this Int's value if odd, else returns thisInt - 1.

Returns this Int's value if odd, else returns thisInt - 1.

def roundUpTo(f: Int => Boolean): Int

Increments the value of an integer while that integer does not match condition. Not guaranteed to terminate.

Increments the value of an integer while that integer does not match condition. Not guaranteed to terminate.

Returns this Int's value if even, else returns thisInt + 1.

Returns this Int's value if even, else returns thisInt + 1.

Returns this Int's value if odd, else returns thisInt + 1.

Returns this Int's value if odd, else returns thisInt + 1.

def scaledStr(pairs: (Int, String)*): String
def scaledStr(i1: Int, s1: String, i2: Int, s2: String, i3: Int, s3: String, pairs: (Int, String)*): String

Takes this Int as a value in arc deconds and converts it to a value of arc degrees.

Takes this Int as a value in arc deconds and converts it to a value of arc degrees.

Takes this Int as a value in arc seconds and converts it to a value of radians.

Takes this Int as a value in arc seconds and converts it to a value of radians.

def semicolonInts(otherInts: Int*): String
def tenthsStr(tenths: Int): String

multiplies this Int by a trillion and returns the result as Long.

multiplies this Int by a trillion and returns the result as Long.

Concrete fields