Trait

scala.math

ScalaNumericAnyConversions

Related Doc: package math

Permalink

trait ScalaNumericAnyConversions extends Any

Conversions which present a consistent conversion interface across all the numeric types, suitable for use in value classes.

Linear Supertypes
Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ScalaNumericAnyConversions
  2. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def byteValue(): Byte

    Permalink
  2. abstract def doubleValue(): Double

    Permalink
  3. abstract def floatValue(): Float

    Permalink
  4. abstract def getClass(): Class[_]

    Permalink
    Definition Classes
    Any
  5. abstract def intValue(): Int

    Permalink
  6. abstract def isWhole(): Boolean

    Permalink

    returns

    true if this number has no decimal component, false otherwise.

  7. abstract def longValue(): Long

    Permalink
  8. abstract def shortValue(): Short

    Permalink
  9. abstract def underlying(): Any

    Permalink

Concrete Value Members

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

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

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

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

    Permalink
    Definition Classes
    Any
  6. def hashCode(): Int

    Permalink
    Definition Classes
    Any
  7. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  8. def isValidByte: Boolean

    Permalink

    Returns true iff this has a zero fractional part, and is within the range of scala.Byte MinValue and MaxValue; otherwise returns false.

  9. def isValidChar: Boolean

    Permalink

    Returns true iff this has a zero fractional part, and is within the range of scala.Char MinValue and MaxValue; otherwise returns false.

  10. def isValidInt: Boolean

    Permalink

    Returns true iff this has a zero fractional part, and is within the range of scala.Int MinValue and MaxValue; otherwise returns false.

  11. def isValidShort: Boolean

    Permalink

    Returns true iff this has a zero fractional part, and is within the range of scala.Short MinValue and MaxValue; otherwise returns false.

  12. def toByte: Byte

    Permalink

    Returns the value of this as a scala.Byte.

    Returns the value of this as a scala.Byte. This may involve rounding or truncation.

  13. def toChar: Char

    Permalink

    Returns the value of this as a scala.Char.

    Returns the value of this as a scala.Char. This may involve rounding or truncation.

  14. def toDouble: Double

    Permalink

    Returns the value of this as a scala.Double.

    Returns the value of this as a scala.Double. This may involve rounding or truncation.

  15. def toFloat: Float

    Permalink

    Returns the value of this as a scala.Float.

    Returns the value of this as a scala.Float. This may involve rounding or truncation.

  16. def toInt: Int

    Permalink

    Returns the value of this as an scala.Int.

    Returns the value of this as an scala.Int. This may involve rounding or truncation.

  17. def toLong: Long

    Permalink

    Returns the value of this as a scala.Long.

    Returns the value of this as a scala.Long. This may involve rounding or truncation.

  18. def toShort: Short

    Permalink

    Returns the value of this as a scala.Short.

    Returns the value of this as a scala.Short. This may involve rounding or truncation.

  19. def toString(): String

    Permalink
    Definition Classes
    Any
  20. def unifiedPrimitiveEquals(x: Any): Boolean

    Permalink

    Should only be called after all known non-primitive types have been excluded.

    Should only be called after all known non-primitive types have been excluded. This method won't dispatch anywhere else after checking against the primitives to avoid infinite recursion between equals and this on unknown "Number" variants.

    Additionally, this should only be called if the numeric type is happy to be converted to Long, Float, and Double. If for instance a BigInt much larger than the Long range is sent here, it will claim equality with whatever Long is left in its lower 64 bits. Or a BigDecimal with more precision than Double can hold: same thing. There's no way given the interface available here to prevent this error.

    Attributes
    protected
  21. def unifiedPrimitiveHashcode(): Int

    Permalink
    Attributes
    protected

Inherited from Any

Ungrouped