A < written directly after a number or after int/float (no space) starts a unit of
measure: 3.0<m/s>, float<kg*m/s^2>. A unit is names (or 1) joined by * and /, each
with an optional integer power ^n (s^-1 is allowed). Anything else inside the brackets is
an error.
Wrong#
fn accel(): float<m/s^2> = 9.8<m/s**2>Fixed#
fn accel(): float<m/s^2> = 9.8<m/s^2>Common causes#
- Writing
**instead of^for a power inside a unit. - A comparison written without spaces, like
3<x>y: put spaces around<(3 < x). - Parentheses in a unit: write
kg/m/sinstead ofkg/(m*s).