spire.math

SafeLong

Related Docs: object SafeLong | package math

sealed trait 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 BigInt 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
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

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

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

  3. abstract def &(rhs: BigInt): SafeLong

  4. abstract def &(rhs: Long): SafeLong

  5. abstract def *(rhs: BigInt): SafeLong

  6. abstract def *(rhs: Long): SafeLong

  7. abstract def +(rhs: BigInt): SafeLong

  8. abstract def +(rhs: Long): SafeLong

  9. abstract def -(rhs: BigInt): SafeLong

  10. abstract def -(rhs: Long): SafeLong

  11. abstract def /(rhs: BigInt): SafeLong

  12. abstract def /(rhs: Long): SafeLong

  13. abstract def /%(rhs: BigInt): (SafeLong, SafeLong)

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

  15. abstract def <<(n: Int): SafeLong

  16. abstract def >>(n: Int): SafeLong

  17. abstract def ^(rhs: BigInt): SafeLong

  18. abstract def ^(rhs: Long): SafeLong

  19. abstract def bitLength: Int

  20. abstract def compare(that: SafeLong): Int

    Definition Classes
    Ordered
  21. abstract def doubleValue(): Double

    Definition Classes
    ScalaNumericAnyConversions
  22. abstract def floatValue(): Float

    Definition Classes
    ScalaNumericAnyConversions
  23. abstract def fold[A, B <: A, C <: A](f: (Long) ⇒ B, g: (BigInt) ⇒ C): A

  24. abstract def gcd(that: SafeLong): SafeLong

  25. abstract def intValue(): Int

    Definition Classes
    ScalaNumericAnyConversions
  26. abstract def isLong: Boolean

  27. abstract def isValidLong: Boolean

  28. abstract def isZero: Boolean

  29. abstract def longValue(): Long

    Definition Classes
    ScalaNumericAnyConversions
  30. abstract def signum: Int

  31. abstract def toBigDecimal: BigDecimal

  32. abstract def toBigInt: BigInt

  33. abstract def unary_-(): SafeLong

  34. abstract def underlying(): AnyRef

    Definition Classes
    ScalaNumericConversions → ScalaNumericAnyConversions → ScalaNumber
  35. abstract def |(rhs: BigInt): SafeLong

  36. abstract def |(rhs: Long): SafeLong

Concrete Value Members

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

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

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

  4. final def &(rhs: SafeLong): SafeLong

  5. final def *(rhs: SafeLong): SafeLong

  6. final def **(rhs: Int): SafeLong

    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).

  7. final def +(rhs: SafeLong): SafeLong

  8. final def -(rhs: SafeLong): SafeLong

  9. final def /(rhs: SafeLong): SafeLong

  10. final def /%(rhs: SafeLong): (SafeLong, SafeLong)

  11. final def /~(rhs: SafeLong): SafeLong

  12. def <(that: SafeLong): Boolean

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

    Definition Classes
    Ordered
  14. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  15. def >(that: SafeLong): Boolean

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

    Definition Classes
    Ordered
  17. final def ^(rhs: SafeLong): SafeLong

  18. final def abs: SafeLong

  19. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  20. def byteValue(): Byte

    Definition Classes
    Number
  21. def clone(): AnyRef

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

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. final def foldWith[A, B <: A, C <: A](that: SafeLong)(f: (Long, Long) ⇒ B, g: (BigInt, BigInt) ⇒ C): A

    If this SafeLong is backed by a Long and that SafeLong is backed by a Long as well, then f will be called with both values.

    If this SafeLong is backed by a Long and that SafeLong is backed by a Long as well, then f will be called with both values. Otherwise, this and that will be converted to BigInts and g will be called with these BigInts.

  27. final def getClass(): Class[_]

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

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

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

  31. def isValidByte: Boolean

    Definition Classes
    ScalaNumericAnyConversions
  32. def isValidChar: Boolean

    Definition Classes
    ScalaNumericAnyConversions
  33. def isValidInt: Boolean

    Definition Classes
    ScalaNumericAnyConversions
  34. def isValidShort: Boolean

    Definition Classes
    ScalaNumericAnyConversions
  35. final def isWhole(): Boolean

    Definition Classes
    SafeLong → ScalaNumericAnyConversions → ScalaNumber
  36. final def map(f: (Long) ⇒ Long, g: (BigInt) ⇒ BigInt): SafeLong

  37. final def max(that: SafeLong): SafeLong

  38. final def min(that: SafeLong): SafeLong

  39. final def modPow(exp: Int, mod: SafeLong): SafeLong

  40. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  41. final def notify(): Unit

    Definition Classes
    AnyRef
  42. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  43. final def pow(rhs: Int): SafeLong

  44. def shortValue(): Short

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

    Definition Classes
    AnyRef
  46. def toByte: Byte

    Definition Classes
    SafeLong → ScalaNumericAnyConversions
  47. def toChar: Char

    Definition Classes
    ScalaNumericAnyConversions
  48. def toDouble: Double

    Definition Classes
    ScalaNumericAnyConversions
  49. def toFloat: Float

    Definition Classes
    ScalaNumericAnyConversions
  50. def toInt: Int

    Definition Classes
    SafeLong → ScalaNumericAnyConversions
  51. def toLong: Long

    Definition Classes
    ScalaNumericAnyConversions
  52. def toShort: Short

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

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

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

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. final def |(rhs: SafeLong): SafeLong

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