From Clomosy Docs
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert"> | |||
function Frac(const X: Extended): Extended; | |||
</div> | |||
The Frac function returns the fractional part of a floating point number. | The Frac function returns the fractional part of a floating point number. | ||
<b>Example</b><br> | |||
:'' | <b>TRObject Syntax</b><br> | ||
<pre> | |||
var | |||
numberValue : Integer; | |||
{ | |||
numberValue = 12.75; | |||
ShowMessage(' Frac(12.75) = '+FloatToStr(Frac(numberValue))); | |||
} | |||
</pre> | |||
<b>Base Syntax</b><br> | |||
<pre> | |||
var | |||
numberValue : Integer; | |||
begin | |||
numberValue := 12.75; | |||
ShowMessage(' Frac(12.75) = '+FloatToStr(Frac(numberValue))); | |||
end; | |||
</pre> | |||
<b>Output:</b><br> | |||
<div class="alert alert-success" role="alert" data-bs-theme="light"> | |||
Frac(12.75) = 0,75 | |||
</div> | |||
<h2> See Also </h2> | |||
* [[System_Library#Math_Functions | Math Functions]] | |||
Revision as of 10:41, 7 October 2024
function Frac(const X: Extended): Extended;
The Frac function returns the fractional part of a floating point number.
Example
TRObject Syntax
var
numberValue : Integer;
{
numberValue = 12.75;
ShowMessage(' Frac(12.75) = '+FloatToStr(Frac(numberValue)));
}
Base Syntax
var
numberValue : Integer;
begin
numberValue := 12.75;
ShowMessage(' Frac(12.75) = '+FloatToStr(Frac(numberValue)));
end;
Output:
Frac(12.75) = 0,75