Welcome to the new DelphiDabbler Code Library Documentation.

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.

Denominator property

Project: Fractions

Unit: DelphiDabbler.Lib.Fractions

Record: TFraction

Applies to: ~>0.1

property Denominator: Int64;

Description

This property provides the denominator of a fraction encapsulated by a TFraction.

The property is always strictly positive in the range 1..High(Int64).

Example

var
  F: TFraction;
begin
  F := TFraction.Create(2, 3);
  Assert(F.Denominator = 3);  // F = 2/3
  F := -F;
  Assert(F.Denominator = -3); // F = -2/3
  F := 0.75;
  Assert(F.Denominator = 4);  // F = 3/4
  F := 42;
  Assert(F.Denominator = 1);  // F = 42/1
end;

See Also