abs()
From Hack Wars Wiki
| Information for free function abs() | |
| Function | abs(float) |
| API | Challenges, Hacktendo |
| Description | Returns the absolute value (in the form of a float) of the float provided. |
Example
If a challenge asked you to find absolute value of the difference of two variables, the script would be:
float x = getInputFloat(); float y = getInputFloat(); float dif = x - y; setOutputFloat(abs(dif)); |
