we have the following math functions in apache pig −
| s.n. | functions & description |
|---|---|
| 1 |
abs(expression)
to get the absolute value of an expression. |
| 2 |
acos(expression)
to get the arc cosine of an expression. |
| 3 |
asin(expression)
to get the arc sine of an expression. |
| 4 |
atan(expression)
this function is used to get the arc tangent of an expression. |
| 5 |
cbrt(expression)
this function is used to get the cube root of an expression. |
| 6 |
ceil(expression)
this function is used to get the value of an expression rounded up to the nearest integer. |
| 7 |
cos(expression)
this function is used to get the trigonometric cosine of an expression. |
| 8 |
cosh(expression)
this function is used to get the hyperbolic cosine of an expression. |
| 9 |
exp(expression)
this function is used to get the euler’s number e raised to the power of x. |
| 10 |
floor(expression)
to get the value of an expression rounded down to the nearest integer. |
| 11 |
log(expression)
to get the natural logarithm (base e) of an expression. |
| 12 |
log10(expression)
to get the base 10 logarithm of an expression. |
| 13 |
random( )
to get a pseudo random number (type double) greater than or equal to 0.0 and less than 1.0. |
| 14 |
round(expression)
to get the value of an expression rounded to an integer (if the result type is float) or rounded to a long (if the result type is double). |
| 15 |
sin(expression)
to get the sine of an expression. |
| 16 |
sinh(expression)
to get the hyperbolic sine of an expression. |
| 17 |
sqrt(expression)
to get the positive square root of an expression. |
| 18 |
tan(expression)
to get the trigonometric tangent of an angle. |
| 19 |
tanh(expression)
to get the hyperbolic tangent of an expression. |