Packages

t

scala.math

ScalaNumericAnyConversions

trait ScalaNumericAnyConversions extends Any

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

Source
ScalaNumericConversions.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ScalaNumericAnyConversions
  2. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def byteValue: Byte
  2. abstract def doubleValue: Double
  3. abstract def floatValue: Float
  4. abstract def intValue: Int
  5. abstract def isWhole: Boolean

    returns

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

  6. abstract def longValue: Long
  7. abstract def shortValue: Short

Concrete Value Members

  1. def isValidByte: Boolean

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

  2. def isValidChar: Boolean

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

  3. def isValidInt: Boolean

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

  4. def isValidShort: Boolean

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

  5. def toByte: Byte

    Returns the value of this as a scala.Byte.

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

  6. def toChar: Char

    Returns the value of this as a scala.Char.

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

  7. def toDouble: Double

    Returns the value of this as a scala.Double.

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

  8. def toFloat: Float

    Returns the value of this as a scala.Float.

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

  9. def toInt: Int

    Returns the value of this as an scala.Int.

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

  10. def toLong: Long

    Returns the value of this as a scala.Long.

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

  11. def toShort: Short

    Returns the value of this as a scala.Short.

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