Project: Fractions
Unit: DelphiDabbler.Lib.Fractions
Record: TFraction
Applies to: ~>0.1
class operator Positive(const F: TFraction): TFraction;
This operator overload enables the unary positive (plus) operator + to be applied to a TFraction.
The operator is a no-op. It returns an exact copy of the fraction.
var
F, FPos: TFraction;
begin
F := TFraction.Create(3, 4);
FPos := +F;
Assert(
(FPos.Numerator = F.Numerator)
and (FPos.Denominator = F.Denominator));
end;