scala.math
The package object scala.math contains methods for performing basic numeric operations such as elementary exponential, logarithmic, root and trigonometric functions.
All methods forward to java.lang.Math unless otherwise noted.
Attributes
- See also
Members list
Grouped members
Mathematical Constants
The Double value that is closer than any other to e, the base of the natural logarithms.
The Double value that is closer than any other to e, the base of the natural logarithms.
Attributes
- Source
- package.scala
The Double value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter.
The Double value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter.
Attributes
- Source
- package.scala
Minimum and Maximum
Find the min or max of two numbers. Note: scala.collection.IterableOnceOps has min and max methods which determine the min or max of a collection.
Value parameters
- x
-
the first value to compare
- y
-
the second value to compare
Attributes
- Source
- package.scala
Value parameters
- x
-
the first value to compare
- y
-
the second value to compare
Attributes
- Source
- package.scala
Rounding
Returns the Double value that is closest in value to the argument and is equal to a mathematical integer.
Returns the Double value that is closest in value to the argument and is equal to a mathematical integer.
Value parameters
- x
-
a
Doublevalue
Attributes
- Returns
-
the closest floating-point value to a that is equal to a mathematical integer.
- Source
- package.scala
There is no reason to round a Long, but this method prevents unintended conversion to Float followed by rounding to Int.
There is no reason to round a Long, but this method prevents unintended conversion to Float followed by rounding to Int.
Attributes
- Note
-
Does not forward to java.lang.Math
- Deprecated
-
[Since version 2.11.0]This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value? - Source
- package.scala
Scaling
Scaling with rounding guarantees
Value parameters
- d
-
the value to be scaled by a power of two
- scaleFactor
-
the power of 2 used to scale
d
Attributes
- Source
- package.scala
Exponential and Logarithmic
Returns Euler's number e raised to the power of a Double value.
Returns Euler's number e raised to the power of a Double value.
Value parameters
- x
-
the exponent to raise
eto.
Attributes
- Returns
-
the value
e^x^, whereeis the base of the natural logarithms. - Source
- package.scala
Returns exp(x) - 1.
Returns exp(x) - 1.
Value parameters
- x
-
the exponent to raise
eto in the computation ofe^x^ - 1
Attributes
- Source
- package.scala
Value parameters
- f
-
the
Floatvalue whose unbiased exponent is to be extracted
Attributes
- Source
- package.scala
Returns the natural logarithm of a Double value.
Returns the natural logarithm of a Double value.
Value parameters
- x
-
the number to take the natural logarithm of
Attributes
- Returns
-
the value
logₑ(x)whereeis Euler's number - Source
- package.scala
Returns the base 10 logarithm of the given Double value.
Returns the base 10 logarithm of the given Double value.
Value parameters
- x
-
the value whose base 10 logarithm is to be computed
Attributes
- Source
- package.scala
Returns the natural logarithm of the sum of the given Double value and 1.
Returns the natural logarithm of the sum of the given Double value and 1.
Value parameters
- x
-
the value for which to compute
ln(1 + x)
Attributes
- Source
- package.scala
Returns the value of the first argument raised to the power of the second argument.
Returns the value of the first argument raised to the power of the second argument.
Value parameters
- x
-
the base.
- y
-
the exponent.
Attributes
- Returns
-
the value
x^y^. - Source
- package.scala
Trigonometric
Arguments in radians
Angular Measurement Conversion
Converts an angle measured in radians to an approximately equivalent angle measured in degrees.
Converts an angle measured in radians to an approximately equivalent angle measured in degrees.
Value parameters
- x
-
angle, in radians
Attributes
- Returns
-
the measurement of the angle
xin degrees. - Source
- package.scala
Converts an angle measured in degrees to an approximately equivalent angle measured in radians.
Converts an angle measured in degrees to an approximately equivalent angle measured in radians.
Value parameters
- x
-
an angle, in degrees
Attributes
- Returns
-
the measurement of the angle
xin radians. - Source
- package.scala
Hyperbolic
Returns the hyperbolic cosine of the given Double value.
Returns the hyperbolic cosine of the given Double value.
Value parameters
- x
-
the value whose hyperbolic cosine is to be returned
Attributes
- Source
- package.scala
Returns the hyperbolic sine of the given Double value.
Returns the hyperbolic sine of the given Double value.
Value parameters
- x
-
the value whose hyperbolic sine is to be returned
Attributes
- Source
- package.scala
Returns the hyperbolic tangent of the given Double value.
Returns the hyperbolic tangent of the given Double value.
Value parameters
- x
-
the value whose hyperbolic tangent is to be returned
Attributes
- Source
- package.scala
Absolute Values
Determine the magnitude of a value by discarding the sign. Results are >= 0.
Value parameters
- x
-
the value whose absolute value is to be determined
Attributes
- Source
- package.scala
Signs
For signum extract the sign of a value. Results are -1, 0 or 1. Note the signum methods are not pure forwarders to the Java versions. In particular, the return type of java.lang.Long.signum is Int, but here it is widened to Long so that each overloaded variant will return the same numeric type it is passed.
Value parameters
- magnitude
-
the value providing the magnitude of the result
- sign
-
the value providing the sign of the result
Attributes
- Source
- package.scala
Value parameters
- x
-
the value whose signum is to be computed
Attributes
- Note
-
Forwards to java.lang.Integer
- Source
- package.scala
Root Extraction
Returns the cube root of the given Double value.
Returns the cube root of the given Double value.
Value parameters
- x
-
the number to take the cube root of
Attributes
- Returns
-
the value ∛x
- Source
- package.scala
Returns the square root of a Double value.
Returns the square root of a Double value.
Value parameters
- x
-
the number to take the square root of
Attributes
- Returns
-
the value √x
- Source
- package.scala
Polar Coordinates
Converts rectangular coordinates (x, y) to polar (r, theta).
Converts rectangular coordinates (x, y) to polar (r, theta).
Value parameters
- x
-
the abscissa coordinate
- y
-
the ordinate coordinate
Attributes
- Returns
-
the theta component of the point
(r, theta)in polar coordinates that corresponds to the point(x, y)in Cartesian coordinates. - Source
- package.scala
Returns the square root of the sum of the squares of both given Double values without intermediate underflow or overflow.
Returns the square root of the sum of the squares of both given Double values without intermediate underflow or overflow.
The r component of the point (r, theta) in polar coordinates that corresponds to the point (x, y) in Cartesian coordinates.
Value parameters
- x
-
the x coordinate value
- y
-
the y coordinate value
Attributes
- Returns
-
sqrt(
x² +y²) without intermediate overflow or underflow - Source
- package.scala
Unit of Least Precision
Returns the size of an ulp of the given Double value.
Returns the size of an ulp of the given Double value.
Value parameters
- x
-
the
Doublevalue whose ulp is to be returned
Attributes
- Source
- package.scala
Pseudo Random Number Generation
Returns a Double value with a positive sign, greater than or equal to 0.0 and less than 1.0.
Returns a Double value with a positive sign, greater than or equal to 0.0 and less than 1.0.
Attributes
- Source
- package.scala
Exact Arithmetic
Integral addition, multiplication, stepping and conversion throwing ArithmeticException instead of underflowing or overflowing
Modulus and Quotient
Calculate quotient values by rounding to negative infinity
Adjacent Floats
Value parameters
- direction
-
the value indicating which of
start's neighbors should be returned - start
-
the starting floating-point value
Attributes
- Source
- package.scala
Type members
Classlikes
BigDecimal represents decimal floating-point numbers of arbitrary precision. By default, the precision approximately matches that of IEEE 128-bit floating point numbers (34 decimal digits, HALF_EVEN rounding mode). Within the range of IEEE binary128 numbers, BigDecimal will agree with BigInt for both equality and hash codes (and will agree with primitive types as well). Beyond that range--numbers with more than 4934 digits when written out in full--the hashCode of BigInt and BigDecimal is allowed to diverge due to difficulty in efficiently computing both the decimal representation in BigDecimal and the binary representation in BigInt.
BigDecimal represents decimal floating-point numbers of arbitrary precision. By default, the precision approximately matches that of IEEE 128-bit floating point numbers (34 decimal digits, HALF_EVEN rounding mode). Within the range of IEEE binary128 numbers, BigDecimal will agree with BigInt for both equality and hash codes (and will agree with primitive types as well). Beyond that range--numbers with more than 4934 digits when written out in full--the hashCode of BigInt and BigDecimal is allowed to diverge due to difficulty in efficiently computing both the decimal representation in BigDecimal and the binary representation in BigInt.
When creating a BigDecimal from a Double or Float, care must be taken as the binary fraction representation of Double and Float does not easily convert into a decimal representation. Three explicit schemes are available for conversion. BigDecimal.decimal will convert the floating-point number to a decimal text representation, and build a BigDecimal based on that. BigDecimal.binary will expand the binary fraction to the requested or default precision. BigDecimal.exact will expand the binary fraction to the full number of digits, thus producing the exact decimal value corresponding to the binary fraction of that floating-point number. BigDecimal equality matches the decimal expansion of Double: BigDecimal.decimal(0.1) == 0.1. Note that since 0.1f != 0.1, the same is not true for Float. Instead, 0.1f == BigDecimal.decimal((0.1f).toDouble).
To test whether a BigDecimal number can be converted to a Double or Float and then back without loss of information by using one of these methods, test with isDecimalDouble, isBinaryDouble, or isExactDouble or the corresponding Float versions. Note that BigInt's isValidDouble will agree with isExactDouble, not the isDecimalDouble used by default.
BigDecimal uses the decimal representation of binary floating-point numbers to determine equality and hash codes. This yields different answers than conversion between Long and Double values, where the exact form is used. As always, since floating-point is a lossy representation, it is advisable to take care when assuming identity will be maintained across multiple conversions.
BigDecimal maintains a MathContext that determines the rounding that is applied to certain calculations. In most cases, the value of the BigDecimal is also rounded to the precision specified by the MathContext. To create a BigDecimal with a different precision than its MathContext, use new BigDecimal(new java.math.BigDecimal(...), mc). Rounding will be applied on those mathematical operations that can dramatically change the number of digits in a full representation, namely multiplication, division, and powers. The left-hand argument's MathContext always determines the degree of rounding, if any, and is the one propagated through arithmetic operations that do not apply rounding themselves.
Value parameters
- bigDecimal
-
the underlying
java.math.BigDecimal - mc
-
the
MathContextspecifying the precision and rounding mode for operations
Attributes
- Companion
- object
- Source
- BigDecimal.scala
- Supertypes
-
trait Ordered[BigDecimal]trait Comparable[BigDecimal]trait ScalaNumericConversionsclass ScalaNumberclass Numbertrait Serializableclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Source
- BigDecimal.scala
- Supertypes
- Self type
-
BigDecimal.type
A type with efficient encoding of arbitrary integers.
A type with efficient encoding of arbitrary integers.
It wraps java.math.BigInteger, with optimization for small values that can be encoded in a Long.
Attributes
- Companion
- object
- Source
- BigInt.scala
- Supertypes
-
trait Comparable[BigInt]trait ScalaNumericConversionsclass ScalaNumberclass Numbertrait Serializableclass Objecttrait Matchableclass AnyShow all
A trait for representing equivalence relations. It is important to distinguish between a type that can be compared for equality or equivalence and a representation of equivalence on some type. This trait is for representing the latter.
A trait for representing equivalence relations. It is important to distinguish between a type that can be compared for equality or equivalence and a representation of equivalence on some type. This trait is for representing the latter.
An equivalence relation is a binary relation on a type. This relation is exposed as the equiv method of the Equiv trait. The relation must be:
- reflexive:
equiv(x, x) == truefor any x of typeT. - symmetric:
equiv(x, y) == equiv(y, x)for anyxandyof typeT. - transitive: if
equiv(x, y) == trueandequiv(y, z) == true, thenequiv(x, z) == truefor anyx,y, andzof typeT.
Type parameters
- T
-
the type of values being compared for equivalence
Attributes
- Companion
- object
- Source
- Equiv.scala
- Supertypes
-
trait Serializableclass Any
- Known subtypes
-
object BigDecimalobject BigIntobject Booleanobject Byteobject Chartrait IeeeEquivobject IeeeEquivtrait StrictEquivobject DeprecatedDoubleEquivobject StrictEquivtrait IeeeEquivobject IeeeEquivtrait StrictEquivobject DeprecatedFloatEquivobject StrictEquivobject Intobject Longobject Shortobject Stringobject Symbolobject Unittrait PartialOrdering[T]trait Ordering[T]object DeadlineIsOrderedobject DurationIsOrderedobject FiniteDurationIsOrderedtrait Numeric[T]trait Fractional[T]trait BigDecimalIsFractionalobject BigDecimalIsFractionaltrait DoubleIsFractionalobject DoubleIsFractionaltrait FloatIsFractionalobject FloatIsFractionaltrait Integral[T]trait BigDecimalAsIfIntegralobject BigDecimalAsIfIntegraltrait BigIntIsIntegralobject BigIntIsIntegraltrait ByteIsIntegralobject ByteIsIntegraltrait CharIsIntegralobject CharIsIntegraltrait IntIsIntegralobject IntIsIntegraltrait LongIsIntegralobject LongIsIntegraltrait ShortIsIntegralobject ShortIsIntegraltrait BigDecimalIsConflictedtrait BigDecimalOrderingobject BigDecimaltrait BigIntOrderingobject BigInttrait BooleanOrderingobject Booleantrait ByteOrderingobject Bytetrait CachedReverse[T]object Inttrait CharOrderingobject Chartrait IeeeOrderingobject IeeeOrderingtrait TotalOrderingobject DeprecatedDoubleOrderingobject TotalOrderingtrait IeeeOrderingobject IeeeOrderingtrait TotalOrderingobject DeprecatedFloatOrderingobject TotalOrderingtrait IntOrderingtrait LongOrderingobject Longtrait OptionOrdering[T]trait ShortOrderingobject Shorttrait StringOrderingobject Stringtrait SymbolOrderingobject Symboltrait UnitOrderingobject UnitShow all
Attributes
- Companion
- trait
- Source
- Equiv.scala
- Supertypes
- Self type
-
Equiv.type
Attributes
- Companion
- object
- Source
- Fractional.scala
- Supertypes
-
trait Numeric[T]trait Ordering[T]trait PartialOrdering[T]trait Equiv[T]trait Serializabletrait Comparator[T]class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
trait BigDecimalIsFractionalobject BigDecimalIsFractionaltrait DoubleIsFractionalobject DoubleIsFractionaltrait FloatIsFractionalobject FloatIsFractionalShow all
Attributes
- Companion
- trait
- Source
- Fractional.scala
- Supertypes
- Self type
-
Fractional.type
Attributes
- Companion
- object
- Source
- Integral.scala
- Supertypes
-
trait Numeric[T]trait Ordering[T]trait PartialOrdering[T]trait Equiv[T]trait Serializabletrait Comparator[T]class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
trait BigDecimalAsIfIntegralobject BigDecimalAsIfIntegraltrait BigIntIsIntegralobject BigIntIsIntegraltrait ByteIsIntegralobject ByteIsIntegraltrait CharIsIntegralobject CharIsIntegraltrait IntIsIntegralobject IntIsIntegraltrait LongIsIntegralobject LongIsIntegraltrait ShortIsIntegralobject ShortIsIntegralShow all
Attributes
- Source
- Ordering.scala
- Supertypes
- Known subtypes
-
object Ordering
Attributes
- Companion
- object
- Source
- Numeric.scala
- Supertypes
-
trait Ordering[T]trait PartialOrdering[T]trait Equiv[T]trait Serializabletrait Comparator[T]class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
trait Fractional[T]trait BigDecimalIsFractionalobject BigDecimalIsFractionaltrait DoubleIsFractionalobject DoubleIsFractionaltrait FloatIsFractionalobject FloatIsFractionaltrait Integral[T]trait BigDecimalAsIfIntegralobject BigDecimalAsIfIntegraltrait BigIntIsIntegralobject BigIntIsIntegraltrait ByteIsIntegralobject ByteIsIntegraltrait CharIsIntegralobject CharIsIntegraltrait IntIsIntegralobject IntIsIntegraltrait LongIsIntegralobject LongIsIntegraltrait ShortIsIntegralobject ShortIsIntegraltrait BigDecimalIsConflictedShow all
A trait for data that have a single, natural ordering. See scala.math.Ordering before using this trait for more information about whether to use scala.math.Ordering instead.
A trait for data that have a single, natural ordering. See scala.math.Ordering before using this trait for more information about whether to use scala.math.Ordering instead.
Classes that implement this trait can be sorted with scala.util.Sorting and can be compared with standard comparison operators (e.g. > and <).
Ordered should be used for data with a single, natural ordering (like integers) while Ordering allows for multiple ordering implementations. An Ordering instance will be implicitly created if necessary.
scala.math.Ordering is an alternative to this trait that allows multiple orderings to be defined for the same type.
scala.math.PartiallyOrdered is an alternative to this trait for partially ordered data.
For example, create a simple class that implements Ordered and then sort it with scala.util.Sorting:
case class OrderedClass(n:Int) extends Ordered[OrderedClass] {
def compare(that: OrderedClass) = this.n - that.n
}
val x = Array(OrderedClass(1), OrderedClass(5), OrderedClass(3))
scala.util.Sorting.quickSort(x)
x
It is important that the equals method for an instance of Ordered[A] be consistent with the compare method. However, due to limitations inherent in the type erasure semantics, there is no reasonable way to provide a default implementation of equality for instances of Ordered[A]. Therefore, if you need to be able to use equality on an instance of Ordered[A] you must provide it yourself either when inheriting or instantiating.
It is important that the hashCode method for an instance of Ordered[A] be consistent with the compare method. However, it is not possible to provide a sensible default implementation. Therefore, if you need to be able compute the hash of an instance of Ordered[A] you must provide it yourself either when inheriting or instantiating.
Type parameters
- A
-
the type of the objects that this object can be compared to
Attributes
- See also
- Companion
- object
- Source
- Ordered.scala
- Supertypes
- Known subtypes
-
class Deadlineclass Durationclass Infiniteclass FiniteDurationclass BigDecimalclass BigInttrait OrderedProxy[T]class RichBooleantrait ScalaNumberProxy[T]trait FractionalProxy[T]class RichDoubleclass RichFloatclass RichInttrait ScalaWholeNumberProxy[T]trait IntegralProxy[T]class RichCharclass RichLongclass RichByteclass RichShortShow all
Ordering is a trait whose instances each represent a strategy for sorting instances of a type.
Ordering is a trait whose instances each represent a strategy for sorting instances of a type.
Ordering's companion object defines many implicit objects to deal with subtypes of AnyVal (e.g. Int, Double), String, and others.
To sort instances by one or more member variables, you can take advantage of these built-in orderings using Ordering.by and Ordering.on:
import scala.util.Sorting
val pairs = Array(("a", 5, 2), ("c", 3, 1), ("b", 1, 3))
// sort by 2nd element
Sorting.quickSort(pairs)(Ordering.by[(String, Int, Int), Int](_._2))
// sort by the 3rd element, then 1st
Sorting.quickSort(pairs)(Ordering[(Int, String)].on(x => (x._3, x._1)))
An Ordering[T] is implemented by specifying the compare method, compare(a: T, b: T): Int, which decides how to order two instances a and b. Instances of Ordering[T] can be used by things like scala.util.Sorting to sort collections like Array[T].
For example:
import scala.util.Sorting
case class Person(name:String, age:Int)
val people = Array(Person("bob", 30), Person("ann", 32), Person("carl", 19))
// sort by age
object AgeOrdering extends Ordering[Person] {
def compare(a:Person, b:Person) = a.age.compare(b.age)
}
Sorting.quickSort(people)(AgeOrdering)
This trait and scala.math.Ordered both provide this same functionality, but in different ways. A type T can be given a single way to order itself by extending Ordered. Using Ordering, this same type may be sorted in many other ways. Ordered and Ordering both provide implicits allowing them to be used interchangeably.
You can import scala.math.Ordering.Implicits._ to gain access to other implicit orderings.
Type parameters
- T
-
the type of objects that this ordering can compare
Attributes
- See also
- Companion
- object
- Source
- Ordering.scala
- Supertypes
-
trait PartialOrdering[T]trait Equiv[T]trait Serializabletrait Comparator[T]class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
object DeadlineIsOrderedobject DurationIsOrderedobject FiniteDurationIsOrderedtrait Numeric[T]trait Fractional[T]trait BigDecimalIsFractionalobject BigDecimalIsFractionaltrait DoubleIsFractionalobject DoubleIsFractionaltrait FloatIsFractionalobject FloatIsFractionaltrait Integral[T]trait BigDecimalAsIfIntegralobject BigDecimalAsIfIntegraltrait BigIntIsIntegralobject BigIntIsIntegraltrait ByteIsIntegralobject ByteIsIntegraltrait CharIsIntegralobject CharIsIntegraltrait IntIsIntegralobject IntIsIntegraltrait LongIsIntegralobject LongIsIntegraltrait ShortIsIntegralobject ShortIsIntegraltrait BigDecimalIsConflictedtrait BigDecimalOrderingobject BigDecimaltrait BigIntOrderingobject BigInttrait BooleanOrderingobject Booleantrait ByteOrderingobject Bytetrait CachedReverse[T]object Inttrait CharOrderingobject Chartrait IeeeOrderingobject IeeeOrderingtrait TotalOrderingobject DeprecatedDoubleOrderingobject TotalOrderingtrait IeeeOrderingobject IeeeOrderingtrait TotalOrderingobject DeprecatedFloatOrderingobject TotalOrderingtrait IntOrderingtrait LongOrderingobject Longtrait OptionOrdering[T]trait ShortOrderingobject Shorttrait StringOrderingobject Stringtrait SymbolOrderingobject Symboltrait UnitOrderingobject UnitShow all
- Self type
-
Ordering[T]
This is the companion object for the scala.math.Ordering trait.
This is the companion object for the scala.math.Ordering trait.
It contains many implicit orderings as well as well as methods to construct new orderings.
Attributes
- Companion
- trait
- Source
- Ordering.scala
- Supertypes
- Self type
-
Ordering.type
Attributes
- Companion
- trait
- Source
- PartialOrdering.scala
- Supertypes
- Self type
-
PartialOrdering.type
A trait for representing partial orderings. It is important to distinguish between a type that has a partial order and a representation of partial ordering on some type. This trait is for representing the latter.
A trait for representing partial orderings. It is important to distinguish between a type that has a partial order and a representation of partial ordering on some type. This trait is for representing the latter.
A partial ordering is a binary relation on a type T, exposed as the lteq method of this trait. This relation must be:
- reflexive:
lteq(x, x) == **true**, for anyxof typeT. - anti-symmetric: if
lteq(x, y) == **true**andlteq(y, x) == **true**thenequiv(x, y) == **true**, for anyxandyof typeT. - transitive: if
lteq(x, y) == **true**andlteq(y, z) == **true**thenlteq(x, z) == **true**, for anyx,y, andzof typeT.
Additionally, a partial ordering induces an equivalence relation on a type T: x and y of type T are equivalent if and only if lteq(x, y) && lteq(y, x) == **true**. This equivalence relation is exposed as the equiv method, inherited from the Equiv trait.
Type parameters
- T
-
the type of elements being ordered
Attributes
- Companion
- object
- Source
- PartialOrdering.scala
- Supertypes
- Known subtypes
-
trait Ordering[T]object DeadlineIsOrderedobject DurationIsOrderedobject FiniteDurationIsOrderedtrait Numeric[T]trait Fractional[T]trait BigDecimalIsFractionalobject BigDecimalIsFractionaltrait DoubleIsFractionalobject DoubleIsFractionaltrait FloatIsFractionalobject FloatIsFractionaltrait Integral[T]trait BigDecimalAsIfIntegralobject BigDecimalAsIfIntegraltrait BigIntIsIntegralobject BigIntIsIntegraltrait ByteIsIntegralobject ByteIsIntegraltrait CharIsIntegralobject CharIsIntegraltrait IntIsIntegralobject IntIsIntegraltrait LongIsIntegralobject LongIsIntegraltrait ShortIsIntegralobject ShortIsIntegraltrait BigDecimalIsConflictedtrait BigDecimalOrderingobject BigDecimaltrait BigIntOrderingobject BigInttrait BooleanOrderingobject Booleantrait ByteOrderingobject Bytetrait CachedReverse[T]object Inttrait CharOrderingobject Chartrait IeeeOrderingobject IeeeOrderingtrait TotalOrderingobject DeprecatedDoubleOrderingobject TotalOrderingtrait IeeeOrderingobject IeeeOrderingtrait TotalOrderingobject DeprecatedFloatOrderingobject TotalOrderingtrait IntOrderingtrait LongOrderingobject Longtrait OptionOrdering[T]trait ShortOrderingobject Shorttrait StringOrderingobject Stringtrait SymbolOrderingobject Symboltrait UnitOrderingobject UnitShow all
- Self type
A class for partially ordered data.
A class for partially ordered data.
Type parameters
- A
-
the type of the elements being ordered
Attributes
- Source
- PartiallyOrdered.scala
- Supertypes
-
class Any
Conversions which present a consistent conversion interface across all the numeric types, suitable for use in value classes.
Conversions which present a consistent conversion interface across all the numeric types, suitable for use in value classes.
Attributes
- Source
- ScalaNumericConversions.scala
- Supertypes
-
class Any
- Known subtypes
-
trait ScalaNumericConversionsclass BigDecimalclass BigInttrait ScalaNumberProxy[T]trait FractionalProxy[T]class RichDoubleclass RichFloatclass RichInttrait ScalaWholeNumberProxy[T]trait IntegralProxy[T]class RichCharclass RichLongclass RichByteclass RichShortShow all
A slightly more specific conversion trait for classes which extend ScalaNumber (which excludes value classes.)
A slightly more specific conversion trait for classes which extend ScalaNumber (which excludes value classes.)
Attributes
- Source
- ScalaNumericConversions.scala
- Supertypes
- Known subtypes
-
class BigDecimalclass BigInt