spire.math

NumberTag

trait NumberTag[A] extends AnyRef

A NumberTag provides information about important implementations details of numbers. For instance, it includes information about whether we can expect arithmetic to overflow or produce invalid values, the bounds of the number if they exist, whether it is an approximate or exact number type, etc.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. NumberTag
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def hasMaxValue: Option[A]

    Returns the largest finite value that A can represent, if one exists.

    Returns the largest finite value that A can represent, if one exists. For instance, the largest finite value representable by Double is 1.7976931348623157E308. On the other hand, BigInt has no largest value.

  2. abstract def hasMinValue: Option[A]

    Returns the smallest finite value that A can represent, if one exists.

    Returns the smallest finite value that A can represent, if one exists. For instance, the smallest finite value representable by Double is -1.7976931348623157E308. On the other hand, BigInt has no smallest value.

  3. abstract def hasNaN: Option[A]

    If A has values that represent an undefined or invalid value, then a repsentitive value may be used here.

    If A has values that represent an undefined or invalid value, then a repsentitive value may be used here. Otherwise this returned None to indicate that all values in A are valid numbers in the extended real number line.

  4. abstract def hasNegativeInfinity: Option[A]

    If A has a value that represents a negative infinity, then it is returned here, otherwise a value of None indicates that negative infinity cannot be represented in A.

  5. abstract def hasPositiveInfinity: Option[A]

    If A has a value that represents a positive infinity, then it is returned here, otherwise a value of None indicates that positive infinity cannot be represented in A.

  6. abstract def hasZero: Option[A]

    If A has a value that represents the real value 0, then it is returned here.

    If A has a value that represents the real value 0, then it is returned here. Otherwise None is returned.

  7. abstract def isInfinite(a: A): Boolean

    Returns true if a is an infinite value (either positive or negative) and false otherwise.

  8. abstract def isNaN(a: A): Boolean

    Returns true if a is an invalid number.

    Returns true if a is an invalid number. Note that positive and negative infinities are valid numbers.

  9. abstract def isSigned: Boolean

    Returns true if A can represent both positive and negative values.

  10. abstract def overflows: Boolean

    Returns true if this value can overflow as a result of arithmetic operations.

    Returns true if this value can overflow as a result of arithmetic operations. Types that overflow include Int and Long.

  11. abstract def resolution: Resolution

    Returns the resolution of this number.

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def finite: Boolean

    Returns true if all values representable by A are finite and live on the real number line.

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

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

    Definition Classes
    AnyRef → Any
  14. def infinite: Boolean

    Returns true if this type can represent arbitrarily large or small values.

  15. def isFinite(a: A): Boolean

    Returns true if a represents a finite value (neither infinite nor invalid).

  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  21. def toString(): String

    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped