This unit, named DelphiDabbler.Lib.Fractions.pas
, provides a single Delphi Pascal "Advanced" record, TFraction, that encapsulates a fraction and a number of operations on it.
A whole bunch of operator overloads make it straightforward to perform all the usual arithmetic operations on a fraction and to cast a TFraction to and from an integer or floating point value.
Testing
DUnit tests for TFraction are included in the download.