Generic Structure


A Measurement is a model type that holds a Double value associated with a Unit.


Measurements support a large set of operators, including +, -, *, /, and a full set of comparison operators.


Type Aliases


init(value: Double, unit: UnitType)

Create a Measurement given a specified value and unit.

Instance Properties

Instance Methods

func convert(to: UnitType)

Converts the measurement to the specified unit.

func converted(to: UnitType)

Returns a new measurement created by converting to the specified unit.

Operator Functions