Answer the question
In order to leave comments, you need to log in
How can I write down the final result of the division?
There are two variables of type Real X1:=1 and X2:=0.2. I need the expression frac(X1/X2) to be equal to 0. Is it possible to do this?
Answer the question
In order to leave comments, you need to log in
Depending on the origin of the number, you can do this.
1. Work with an error. For example.
q := X1 / X2;
if abs(q - Round(q)) < 1e-5 then ...
type
TRatio = record
Num, Den : integer;
end;
var
X1 : integer = 100;
X2 : integer = 20;
if X1 mod X2 = 0 then ...
type
TDecFloat = record
mantissa : uint64; // например, от 1e17 до 1e18
order : integer;
sign : boolean;
end;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question