Description |
The Frac function returns the fractional part of a floating point number.
|
|
Related commands |
Int |
|
The integer part of a floating point number as a float |
Round |
|
Rounds a floating point number to an integer |
Trunc |
|
The integer part of a floating point number |
|
|
|
Example code : A simple example |
begin
WriteLn('Round(12.75) = '+IntToStr(Round(12.75)));
WriteLn('Trunc(12.75) = '+IntToStr(Trunc(12.75)));
WriteLn(' Int(12.75) = '+FloatToStr(Int(12.75)));
WriteLn(' Frac(12.75) = '+FloatToStr(Frac(12.75)));
end;
|
Show full unit code |
Round(12.75) = 13
Trunc(12.75) = 12
Int(12.75) = 12
Frac(12.75) = 0.75
|
|