# Computing with units

### 11.1.2 Computing with units

Xcas performs usual arithmetic operations (+, -, *, /, ^) on unit objects. Different units may be used, but for + and - they must be compatible. The result is an unit object

- For the multiplication and the division of two unit objects _u1 and _u2, the unit of the result is written _(u1*u2) and _(u1/u2).
- For an addition or a subtraction of compatible unit objects, the result is expressed with the same unit as the first term of the operation.

#### Examples.

- Input:
  1_m+100_cm
  Output:

  2.0 m

- Input:
  100_cm+1_m
  Output:

  200.0 cm

- Input:
  1_m*100_cm
  Output:

  100 cm m