[][src]Module cpc::units

Units, and functions you can use with them

Enums

Unit

A Unit enum. Note that it can also be NoUnit.

UnitType

An enum of all possible unit types, like Length, DigitalStorage etc. There is also a NoType unit type for normal numbers.

Functions

add

Return the sum of two Numbers

convert

Convert a Number to a specified Unit.

convert_to_lowest

If one of two provided Numbers has a larger Unit than the other, convert the large one to the unit of the small one.

divide

Divide a Number by another Number

get_conversion_factor

Returns the conversion factor between two units.

modulo

Modulo a Number by another Number.

multiply

Multiply two Numbers

pow

Returns a Number to the power of another Number

subtract

Subtract a Number from another Number

to_ideal_unit

Convert Number to an ideal unit.