2015-04-17 04:52:51 +00:00
|
|
|
## Abs
|
2015-05-01 20:05:55 +00:00
|
|
|
Return the absolute value of the parameter.
|
2015-04-17 04:52:51 +00:00
|
|
|
|
2015-04-18 14:41:34 +00:00
|
|
|
### Declaration
|
2015-04-17 04:52:51 +00:00
|
|
|
```glsl
|
|
|
|
float abs(float x)
|
|
|
|
vec2 abs(vec2 x)
|
|
|
|
vec3 abs(vec3 x)
|
|
|
|
vec4 abs(vec4 x)
|
|
|
|
```
|
|
|
|
|
|
|
|
### Parameters
|
2015-04-18 14:41:34 +00:00
|
|
|
```x``` specify the value of which to return the absolute.
|
2015-04-17 04:52:51 +00:00
|
|
|
|
|
|
|
### Description
|
|
|
|
```abs()``` returns the absolute value of ```x```.
|
|
|
|
|
|
|
|
<div class="simpleFunction" data="y = abs(x); "></div>
|
|
|
|
|
|
|
|
### See Also
|
2015-04-18 14:41:34 +00:00
|
|
|
[sign()](index.html#sign.md), [min()](index.html#min.md), [max()](index.html#max.md), [Chapter 05: Shaping Functions](../05/)
|