thebookofshaders/glossary/abs.md
2015-04-18 10:41:34 -04:00

493 B

Abs

Return the absolute value of the parameter

Declaration

float abs(float x)  
vec2 abs(vec2 x)  
vec3 abs(vec3 x)  
vec4 abs(vec4 x)

Parameters

x specify the value of which to return the absolute.

Description

abs() returns the absolute value of x.

See Also

sign(), min(), max(), Chapter 05: Shaping Functions