Skip to content
Ryzom Core Wiki edited this page Jul 8, 2024 · 3 revisions

title: Abs description: published: true date: 2023-03-16T23:04:32.248Z tags: editor: markdown dateCreated: 2023-03-16T22:20:25.697Z

abs

The abs native AI script function returns the absolute value of the input value.

Syntax

(absolute\_value: f)abs(value: f) // abs_f_f

Arguments

  • value (float): The input value.

Return values

  • absolute_value (float): The absolute value of the input value (always positive).

Examples

(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.

Clone this wiki locally