Precision class
Represents the amount of precision for a measurement.
Because measurements are not perfectly precise, we do not want to imply that we know more than what we actually know to be true. For details, see Significant Figures
Measurements such as Distance will make use of a Precision you provide by giving answers within the bounds of the precision you specify when asked for any measurement value.
In general, measurements will not be considered "equal" if they have different precision, even if their measured values are the same.
Distance.meters(3.14159, precision: Precision(3)) ==
Distance.meters(3.14159, precision: Precision(5)); // evaluates to false
Constructors
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withPrecision(
num value) → double - Interprets the specified number according to this Precision.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
addition<
T extends Measurement< (T> >Measurement< T> a, Measurement<T> b) → Precision - Combines two Precisions per the "addition rule".
-
digitsAfterDecimal(
Measurement< Measurement> measurement) → int - Calculates the number of significant digits after the decimal point.
-
digitsBeforeDecimal(
double number) → int - Calculates the number of digits (significant or not) before the decimal.