From Clomosy Docs
No edit summary |
ClomosyAdmin (talk | contribs) No edit summary |
||
| Line 30: | Line 30: | ||
<h2> See Also </h2> | <h2> See Also </h2> | ||
* [[System_Library#Math_Functions | Math Functions]] | * [[System_Library#Math_Functions | Math Functions]] | ||
{{#seo:|description=Learn how to use the Abs function in Clomosy to find the absolute value of integers and real numbers, with examples and practical usage tips.}} | |||
Revision as of 11:05, 24 December 2024
function Abs(X: Integer): Integer; overload;
function Abs(X: Real): Real; overload;
Returns an absolute value.
Abs returns the absolute value of the argument, X.
X is an integer-type or real-type expression.
Example
var
i : Integer;
{
i = -1235;
ShowMessage('Before: '+ IntToStr(i));
//The absolute value of i is taken and put back to i.
i = Abs(i);
ShowMessage('After: '+IntToStr(i));
}
Output:
Before: -1235
After: 1235