Previous Up Next

5.1.1  Notation of unit objects

A unit object has two parts : a real number and a unit expression (a single unit or multiplicative combinaison of unit). The two parts are linked by the character _ ("underscore"). For example 2_m for 2 meters. For composite units, parenthesis must be used, e.g. 1_(m*s).
If a prefix is put before the unit then the unit is multiplicated by a power of 10. For example k or K for kilo (indicate a multiplication by 103), D for deca (indicate a multiplication by 10), d for deci (indicate a multiplication by 10−1) etc...
Input :

10.5_m

Output :

a unit object of value 10.5 meters

Input :

10.5_km

Output :

a unit object of value 10.5 kilometers

Previous Up Next