final class IntExtensions extends AnyVal
Extension methods for Int.
- Alphabetic
- By Inheritance
- IntExtensions
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- def %%(divisor: Int): Int
More useful definition of modulus where a negative number divided by a positive divisor produces a non negative modulus.
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def atLeast0: Int
Returns the value or 0, if this Int less than 0.
- def atMost0: Int
Returns the value or 0, if this Int more than 0.
- def billion: Long
- def commaInts(otherInts: Int*): String
- def degsToRadians: Double
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.
- Annotations
- @inline()
- def degsToSecs: Int
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.
- Annotations
- @inline()
- def diff(operand: Int): Int
- def div2: Int
- def div2RoundDown: Int
- def div2RoundUp: Int
- def div4: Int
- def div4Rem0: Boolean
Dividing by 4 gives remainder of 0.
- def div4Rem1: Boolean
- def div4Rem2: Boolean
Dividing by 4 gives remainder of 2.
- def div4Rem3: Boolean
- def div8Rem2: Boolean
- def div8Rem4: Boolean
- def div8Rem6: Boolean
- def divRoundUp(operand: Int): Int
Divides rounding up.
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.
- 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.
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- def hexStr: String
- Annotations
- @inline()
- def hexStr2: String
- Annotations
- @inline()
- 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.
- 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.
- 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.
- Annotations
- @inline()
- 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.
- def ifSumEven[A](evenVal: => A, oddVal: => A, operand: Int): A
- def ifSumOdd[A](oddVal: => A, evenVal: => A, operand: Int): A
- def isDivBy3: Boolean
- def isDivBy8: Boolean
- def isEven: Boolean
Returns true if this Int is even, false if this Int is odd.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isOdd: Boolean
Returns true if this Int is even, false if this Int is odd.
- def million: Int
- def power(operand: Int): Int
Only use positive value that won't overflow int)
- def quadrillion: Long
- def radiansToDegs: Double
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.
- Annotations
- @inline()
- def radiansToSecs: Double
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.
- Annotations
- @inline()
- def roundDownTo(f: (Int) => Boolean): Int
Decrements the value of an integer while that integer does not match condition.
Decrements the value of an integer while that integer does not match condition. Not guaranteed to terminate.
- def roundDownToEven: Int
- def roundDownToOdd: Int
- def roundUpTo(f: (Int) => Boolean): Int
Increments the value of an integer while that integer does not match condition.
Increments the value of an integer while that integer does not match condition. Not guaranteed to terminate.
- def roundUpToEven: Int
- def roundUpToOdd: Int
- def secsToDegs: Double
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.
- Annotations
- @inline()
- def secsToRadians: Double
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.
- Annotations
- @inline()
- def semicolonInts(otherInts: Int*): String
- def spaces: String
- def str2Dig: String
- def tenthsStr(tenths: Int): String
- val thisInt: Int
- def toString(): String
- Definition Classes
- Any
- def trillion: Long