System.Math.FMod

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function FMod(const ANumerator, ADenominator: Single): Single;
function FMod(const ANumerator, ADenominator: Double): Double;
function FMod(const ANumerator, ADenominator: Extended): Extended;

C++

extern DELPHI_PACKAGE float __fastcall FMod(const float ANumerator, const float ADenominator)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.Math.pas
System.Math.hpp
System.Math System.Math

Description

Returns the remainder of ANumerator / ADenominator (like mod in integers) with the same sign as ANumerator.

The function works in similar way as the mod operator for Integers, but for floating point numbers.

The functions admits the following real types:

For example:

Uses

System.Math;

procedure TForm1.CalculateRemainder;
var
  Value1 : Single;
  Value2 : Single;
begin
  Value1 := Edit1.Text.ToSingle;
  Value2 := Edit2.Text.ToSingle;
  Edit3.Text :=  Fmod( Value1, Value2).ToString;
end;

See Also