Numerical
Trait defining the behavior of "numerical" objects.
Attributes
- Graph
-
- Supertypes
- Known subtypes
-
trait Fieldtrait Multivariatetrait Complexclass BaseComplexclass ComplexCartesianclass ComplexPolarclass Realobject NaNtrait Numberclass GeneralNumberclass ExactNumberclass FuzzyNumberShow all
Members list
Value members
Abstract methods
Computes the absolute value of this Numerical instance. The result is a Numerical object representing a non-negative magnitude of this instance.
Computes the absolute value of this Numerical instance. The result is a Numerical object representing a non-negative magnitude of this instance.
Attributes
- Returns
-
a Numerical object representing the absolute value of this instance.
Method to return this Field as a Complex. If this is a Real number x, return ComplexPolar(x) otherwise, return this.
Method to return this Field as a Complex. If this is a Real number x, return ComplexPolar(x) otherwise, return this.
Attributes
- Returns
-
a Complex.
Method to return this Field as a Real, if possible. If this is a Real number x, return Some(x) otherwise, return None.
Method to return this Field as a Real, if possible. If this is a Real number x, return Some(x) otherwise, return None.
Attributes
- Returns
-
an Option[Real].
Yields the inverse of this Field. This Number is first normalized so that its factor is PureNumber, since we cannot directly invert Numbers with other factors. TODO note that this method does not belong in Numerical: it belongs in Field.
Yields the inverse of this Field. This Number is first normalized so that its factor is PureNumber, since we cannot directly invert Numbers with other factors. TODO note that this method does not belong in Numerical: it belongs in Field.
Attributes
Method to determine if this Field has infinite magnitude.
Method to determine if this Field has infinite magnitude.
Attributes
- Returns
-
true if the magnitude of this Field is infinite.
Determines whether the magnitude of this Numerical instance is probably zero based on a given probability threshold.
Determines whether the magnitude of this Numerical instance is probably zero based on a given probability threshold.
Value parameters
- confidence
-
the probability threshold (default is oneSigma). A higher value increases the confidence needed to determine that the magnitude is zero.
Attributes
- Returns
-
true if the magnitude is considered to be probably zero based on the probability threshold, false otherwise.
Method to determine if this Numerical is equivalent to another Numerical object (x).
Method to determine if this Numerical is equivalent to another Numerical object (x).
Value parameters
- x
-
the other Numerical.
Attributes
- Returns
-
true if they are most probably the same, otherwise false.
Method to determine if this Field has unity magnitude. Unity is the multiplicative identity.
Method to determine if this Field has unity magnitude. Unity is the multiplicative identity.
Attributes
- Returns
-
true if the magnitude of this Field is one.
Method to determine if this Field has zero magnitude. Zero is the additive identity.
Method to determine if this Field has zero magnitude. Zero is the additive identity.
Attributes
- Returns
-
true if the magnitude of this Field is zero.
Method to "normalize" a field.
Method to "normalize" a field.
Attributes
- Returns
-
a Field which is in canonical form.
Determine the "sign" of this field. For a real-valued quantity (Real or Number), we try to determine if it is to the right, left or at the origin. For a complex number, we get the signum of the real part.
Determine the "sign" of this field. For a real-valued quantity (Real or Number), we try to determine if it is to the right, left or at the origin. For a complex number, we get the signum of the real part.
Attributes
- Returns
-
+1 if to the right of the origin, -1 if to the left, 0 if at the origin.
Inherited methods
Converts this NumberLike object into an optional java.lang.Number provided that the conversion can be performed without loss of precision.
Converts this NumberLike object into an optional java.lang.Number provided that the conversion can be performed without loss of precision.
The method determines whether the current NumberLike object can be represented as a java.lang.Number by leveraging the asNumber method and further evaluating certain conditions:
- If the
NumberLikeobject is anExactNumberand its factor isPureNumber, the result is converted usingValue.asJavaNumber. - If the
NumberLikeobject is aFuzzyNumberwith awigglevalue below a specified tolerance, the result is also converted usingValue.asJavaNumber. - In all other cases,
Noneis returned.
Attributes
- Returns
-
an optional
java.lang.Numberrepresentation of this object. The result isSome(java.lang.Number)if the conversion is successful under the stated conditions; otherwise,None. - Inherited from:
- NumberLike
Method to determine if this NumberLike object is a member of the given set.
Method to determine if this NumberLike object is a member of the given set.
Value parameters
- set
-
the candidate NumberSet.
Attributes
- Returns
-
true if this is exact and belongs to set.
- Inherited from:
- NumberLike
Method to determine the NumberSet, if any, to which this NumberLike object belongs. NOTE that we don't yet support H, the quaternions.
Method to determine the NumberSet, if any, to which this NumberLike object belongs. NOTE that we don't yet support H, the quaternions.
Attributes
- Returns
-
Some(numberSet) or None if it doesn't belong to any (for example, it is fuzzy).
- Inherited from:
- NumberLike
Method to show this NumberLike in a human-friendly manner. Subclasses may override for prettier output (vulgar fractions, dropped trailing zeros, etc.). The default falls back to render.
Method to show this NumberLike in a human-friendly manner. Subclasses may override for prettier output (vulgar fractions, dropped trailing zeros, etc.). The default falls back to render.
Attributes
- Returns
-
a String
- Inherited from:
- NumberLike
Inherited and Abstract methods
Method to represent this NumberLike object as an optional Number. The result will be defined if: (1) we do not lose precision and (2) this object is not complex.
Method to represent this NumberLike object as an optional Number. The result will be defined if: (1) we do not lose precision and (2) this object is not complex.
NOTE: to force this as a Number, use convertToNumber in the companion Object.
CONSIDER redefining this as Option[Field] or Option[Real].
Attributes
- Returns
-
a Some(x) if this is a Number; otherwise return None.
- Inherited from:
- NumberLike
Method to determine if this NumberLike object is exact. For instance, Number.pi is exact, although if you converted it into a PureNumber, it would no longer be exact.
Method to determine if this NumberLike object is exact. For instance, Number.pi is exact, although if you converted it into a PureNumber, it would no longer be exact.
Attributes
- Returns
-
true if this NumberLike object is exact in the context of No factor, else false.
- Inherited from:
- NumberLike
Method to determine what Factor, if there is such, this NumberLike object is based on. Unlike context, a None result is not permissive.
Method to determine what Factor, if there is such, this NumberLike object is based on. Unlike context, a None result is not permissive.
Attributes
- Returns
-
an optional
Factor. - Inherited from:
- NumberLike
Method to render this NumberLike in a presentable manner.
Method to render this NumberLike in a presentable manner.
Attributes
- Returns
-
a String
- Inherited from:
- NumberLike