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.
- Alphabetic
- By Inheritance
- NumberTag
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
hasMaxValue: Option[A]
Returns the largest finite value that
Acan represent, if one exists.Returns the largest finite value that
Acan represent, if one exists. For instance, the largest finite value representable byDoubleis1.7976931348623157E308. On the other hand,BigInthas no largest value. -
abstract
def
hasMinValue: Option[A]
Returns the smallest finite value that
Acan represent, if one exists.Returns the smallest finite value that
Acan represent, if one exists. For instance, the smallest finite value representable byDoubleis-1.7976931348623157E308. On the other hand,BigInthas no smallest value. -
abstract
def
hasNaN: Option[A]
If
Ahas values that represent an undefined or invalid value, then a repsentitive value may be used here.If
Ahas values that represent an undefined or invalid value, then a repsentitive value may be used here. Otherwise this returnedNoneto indicate that all values inAare valid numbers in the extended real number line. -
abstract
def
hasNegativeInfinity: Option[A]
If
Ahas a value that represents a negative infinity, then it is returned here, otherwise a value ofNoneindicates that negative infinity cannot be represented inA. -
abstract
def
hasPositiveInfinity: Option[A]
If
Ahas a value that represents a positive infinity, then it is returned here, otherwise a value ofNoneindicates that positive infinity cannot be represented inA. -
abstract
def
hasZero: Option[A]
If
Ahas a value that represents the real value 0, then it is returned here.If
Ahas a value that represents the real value 0, then it is returned here. OtherwiseNoneis returned. -
abstract
def
isInfinite(a: A): Boolean
Returns
trueifais an infinite value (either positive or negative) and false otherwise. -
abstract
def
isNaN(a: A): Boolean
Returns
trueifais an invalid number.Returns
trueifais an invalid number. Note that positive and negative infinities are valid numbers. -
abstract
def
isSigned: Boolean
Returns true if
Acan represent both positive and negative values. -
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
IntandLong. -
abstract
def
resolution: Resolution
Returns the resolution of this number.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
finite: Boolean
Returns true if all values representable by
Aare finite and live on the real number line. -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
infinite: Boolean
Returns true if this type can represent arbitrarily large or small values.
-
def
isFinite(a: A): Boolean
Returns
trueifarepresents a finite value (neither infinite nor invalid). -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )