abs - ryzom/ryzomcore GitHub Wiki


title: Abs description: published: true date: 2023-03-12T18:17:55.749Z tags: editor: markdown dateCreated: 2023-03-12T18:17:52.613Z

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.

⚠️ **GitHub.com Fallback** ⚠️