Class/Object

spire.math

SafeLong

Related Docs: object SafeLong | package math

Permalink

sealed abstract class SafeLong extends ScalaNumber with ScalaNumericConversions with Ordered[SafeLong]

Provides a type to do safe long arithmetic. This type will never overflow, but rather convert the underlying long to a BigInteger as need and back down to a Long when possible.

Self Type
SafeLong
Linear Supertypes
Ordered[SafeLong], Comparable[SafeLong], ScalaNumericConversions, ScalaNumericAnyConversions, ScalaNumber, java.lang.Number, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SafeLong
  2. Ordered
  3. Comparable
  4. ScalaNumericConversions
  5. ScalaNumericAnyConversions
  6. ScalaNumber
  7. Number
  8. Serializable
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def %(rhs: Long): SafeLong

    Permalink
  2. abstract def &(rhs: Long): SafeLong

    Permalink
  3. abstract def *(rhs: Long): SafeLong

    Permalink
  4. abstract def +(rhs: Long): SafeLong

    Permalink
  5. abstract def -(rhs: Long): SafeLong

    Permalink
  6. abstract def /(rhs: Long): SafeLong

    Permalink
  7. abstract def /%(rhs: Long): (SafeLong, SafeLong)

    Permalink
  8. abstract def <<(n: Int): SafeLong

    Permalink
  9. abstract def >>(n: Int): SafeLong

    Permalink
  10. abstract def ^(rhs: Long): SafeLong

    Permalink
  11. abstract def abs: SafeLong

    Permalink
  12. abstract def bitLength: Int

    Permalink
  13. abstract def compare(that: SafeLong): Int

    Permalink
    Definition Classes
    Ordered
  14. abstract def doubleValue(): Double

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  15. abstract def floatValue(): Float

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  16. abstract def gcd(that: SafeLong): SafeLong

    Permalink
  17. abstract def getLong: Opt[Long]

    Permalink
  18. abstract def intValue(): Int

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  19. abstract def isEven: Boolean

    Permalink
  20. abstract def isOdd: Boolean

    Permalink
  21. abstract def isOne: Boolean

    Permalink
  22. abstract def isValidLong: Boolean

    Permalink
  23. abstract def isZero: Boolean

    Permalink
  24. abstract def longValue(): Long

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  25. abstract def signum: Int

    Permalink
  26. abstract def toBigDecimal: BigDecimal

    Permalink
  27. abstract def unary_-(): SafeLong

    Permalink
  28. abstract def underlying(): AnyRef

    Permalink
    Definition Classes
    ScalaNumericConversions → ScalaNumericAnyConversions → ScalaNumber
  29. abstract def |(rhs: Long): SafeLong

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def %(rhs: BigInt): SafeLong

    Permalink
  4. final def %(rhs: SafeLong): SafeLong

    Permalink
  5. final def &(rhs: BigInt): SafeLong

    Permalink
  6. final def &(rhs: SafeLong): SafeLong

    Permalink
  7. final def *(rhs: BigInt): SafeLong

    Permalink
  8. final def *(rhs: SafeLong): SafeLong

    Permalink
  9. final def **(k: Int): SafeLong

    Permalink

    Exponentiation function, e.g.

    Exponentiation function, e.g. x ** y

    If base ** exponent doesn't fit in a Long, the result will overflow (unlike scala.math.pow which will return +/- Infinity).

  10. final def +(rhs: BigInt): SafeLong

    Permalink
  11. final def +(rhs: SafeLong): SafeLong

    Permalink
  12. final def -(rhs: BigInt): SafeLong

    Permalink
  13. final def -(rhs: SafeLong): SafeLong

    Permalink
  14. final def /(rhs: BigInt): SafeLong

    Permalink
  15. final def /(rhs: SafeLong): SafeLong

    Permalink
  16. final def /%(rhs: BigInt): (SafeLong, SafeLong)

    Permalink
  17. final def /%(rhs: SafeLong): (SafeLong, SafeLong)

    Permalink
  18. final def /~(rhs: SafeLong): SafeLong

    Permalink
  19. def <(that: SafeLong): Boolean

    Permalink
    Definition Classes
    Ordered
  20. def <=(that: SafeLong): Boolean

    Permalink
    Definition Classes
    Ordered
  21. def =!=(that: SafeLong): Boolean

    Permalink
  22. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  23. def ===(that: SafeLong): Boolean

    Permalink
  24. def >(that: SafeLong): Boolean

    Permalink
    Definition Classes
    Ordered
  25. def >=(that: SafeLong): Boolean

    Permalink
    Definition Classes
    Ordered
  26. final def ^(rhs: BigInt): SafeLong

    Permalink
  27. final def ^(rhs: SafeLong): SafeLong

    Permalink
  28. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  29. def byteValue(): Byte

    Permalink
    Definition Classes
    Number
  30. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. def compareTo(that: SafeLong): Int

    Permalink
    Definition Classes
    Ordered → Comparable
  32. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  33. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  34. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  35. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  36. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  37. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  38. final def isProbablePrime(c: Int): Boolean

    Permalink
  39. def isValidByte: Boolean

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  40. def isValidChar: Boolean

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  41. def isValidInt: Boolean

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  42. def isValidShort: Boolean

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  43. final def isWhole(): Boolean

    Permalink
    Definition Classes
    SafeLong → ScalaNumericAnyConversions → ScalaNumber
  44. def lcm(that: SafeLong): SafeLong

    Permalink
  45. final def max(that: SafeLong): SafeLong

    Permalink
  46. final def min(that: SafeLong): SafeLong

    Permalink
  47. final def modPow(k: Int, mod: SafeLong): SafeLong

    Permalink
  48. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  49. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  50. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  51. final def pow(k: Int): SafeLong

    Permalink
  52. def shortValue(): Short

    Permalink
    Definition Classes
    Number
  53. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  54. final def toBigInt: BigInt

    Permalink
  55. def toByte: Byte

    Permalink
    Definition Classes
    SafeLong → ScalaNumericAnyConversions
  56. def toChar: Char

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  57. def toDouble: Double

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  58. def toFloat: Float

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  59. def toInt: Int

    Permalink
    Definition Classes
    SafeLong → ScalaNumericAnyConversions
  60. def toLong: Long

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  61. def toShort: Short

    Permalink
    Definition Classes
    SafeLong → ScalaNumericAnyConversions
  62. def toString(): String

    Permalink
    Definition Classes
    SafeLong → AnyRef → Any
  63. def unifiedPrimitiveEquals(x: Any): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    ScalaNumericAnyConversions
  64. def unifiedPrimitiveHashcode(): Int

    Permalink
    Attributes
    protected
    Definition Classes
    ScalaNumericAnyConversions
  65. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  66. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  67. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  68. final def |(rhs: BigInt): SafeLong

    Permalink
  69. final def |(rhs: SafeLong): SafeLong

    Permalink

Inherited from Ordered[SafeLong]

Inherited from Comparable[SafeLong]

Inherited from ScalaNumericConversions

Inherited from ScalaNumericAnyConversions

Inherited from ScalaNumber

Inherited from java.lang.Number

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped