abs - ryzom/ryzomcore GitHub Wiki
title: Abs description: published: true date: 2023-03-16T23:04:32.248Z tags: editor: markdown dateCreated: 2023-03-16T22:20:25.697Z
The abs native AI script function returns the absolute value of the input value.
(absolute\_value: f)abs(value: f) // abs_f_f
- value (float): The input value.
- absolute_value (float): The absolute value of the input value (always positive).
(dist)abs(diff);
This example code calls the abs function with a difference between two values as input and returns and assigns the absolute value of that difference to the variable dist
.