This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.
Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.
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;