mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:09:17 +02:00
parent
5c9b39549a
commit
82d57d9ca8
@ -172,6 +172,7 @@ function EnsureRange(const AValue, AMin, AMax: Double): Double;inline;
|
|||||||
|
|
||||||
|
|
||||||
procedure DivMod(Dividend: Integer; Divisor: Word; var Result, Remainder: Word);
|
procedure DivMod(Dividend: Integer; Divisor: Word; var Result, Remainder: Word);
|
||||||
|
procedure DivMod(Dividend: Integer; Divisor: Word; var Result, Remainder: SmallInt);
|
||||||
|
|
||||||
|
|
||||||
// Sign functions
|
// Sign functions
|
||||||
@ -2067,7 +2068,7 @@ end;
|
|||||||
// Some CPUs probably allow a faster way of doing this in a single operation...
|
// Some CPUs probably allow a faster way of doing this in a single operation...
|
||||||
// There weshould define CPUDIVMOD in the header mathuh.inc and implement it using asm.
|
// There weshould define CPUDIVMOD in the header mathuh.inc and implement it using asm.
|
||||||
{$ifndef CPUDIVMOD}
|
{$ifndef CPUDIVMOD}
|
||||||
procedure DivMod(Dividend: Integer; Divisor: Word; var Result, Remainder: Word);
|
procedure DivMod(Dividend: Integer; Divisor: Word; var Result, Remainder: Word);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=Dividend Div Divisor;
|
Result:=Dividend Div Divisor;
|
||||||
@ -2075,6 +2076,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
|
||||||
|
procedure DivMod(Dividend: Integer; Divisor: Word; var Result, Remainder: SmallInt);
|
||||||
|
var
|
||||||
|
UnsignedResult: Word absolute Result;
|
||||||
|
UnsignedRemainder: Word absolute Remainder;
|
||||||
|
begin
|
||||||
|
DivMod(Dividend, Divisor, UnsignedResult, UnsignedRemainder);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function ifthen(val:boolean;const iftrue:integer; const iffalse:integer= 0) :integer;
|
function ifthen(val:boolean;const iftrue:integer; const iffalse:integer= 0) :integer;
|
||||||
begin
|
begin
|
||||||
if val then result:=iftrue else result:=iffalse;
|
if val then result:=iftrue else result:=iffalse;
|
||||||
|
Loading…
Reference in New Issue
Block a user