Mathematical Functions
abs(x)
(since EVL 2.7)
min(x)
max(x)
(since EVL 2.7)
round(x)
ceil(x)
floor(x)
trunc(x)
(since EVL 2.7)
‘round’ to the nearest integer, when exactly in the middle (e.g. 2.5) round it up. ‘ceil’ and ‘floor’ round always down or up to the nearest integer. ‘trunc’ truncates the fractional part.
*out->rounded = round(2.56); // 3.00 *out->ceiling = ceil(2.56); // 3.00 *out->floored = floor(2.56); // 2.00 *out->truncated = trunc(2.56); // 2.00 *out->rounded = round(-2.56); // -3.00 *out->ceiling = ceil(-2.56); // -2.00 *out->floored = floor(-2.56); // -3.00 *out->truncated = trunc(-2.56); // -2.00
When the argument is ‘nullptr’, all functions return ‘nullptr’. But in such case you need to use pointer manipulation, so the example would look like:
out->rounded = round(in->value);
pow(x)
sqrt(x)
(since EVL 2.7)