Generic Structure

Measurement

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

Overview

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

Symbols

Type Aliases

Initializers

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