From ZCubes Wiki
Jump to navigation Jump to search

You can do computations on fractions in Z3

FRACTION("1 1/2").add(FRACTION("1 1/2"));
FRACTION("1 1/3").subtract(FRACTION("1 1/2"));
FRACTION("1 1/3").multiply(FRACTION("2 5/3"));
FRACTION("1 1/3").divide(FRACTION("2 5/3"));

z^3 uses the following notation for fractions. 2%%3 for 2/3, (1.2%%3) for 1 2/3 etc.


gives 1 4/5

Note fraction additions etc. uses the Unit Conversion operators such as <+>, <->, etc. Hence it is also possibly to convert to meters etc.


gives 1m.


gives 2 2/5m


gives 2 2/5m


gives 2 2/5m


gives 8 2/5m


gives 5 2/5m


gives 5 2/5m