Computing with units

### 24.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

1_m+100_cm

2.0 m |  |  |  |  |  |  |  |  |  |

100_cm+1_m

200.0 cm |  |  |  |  |  |  |  |  |  |