Iron Realms Entertainment
Perform the ‘distance’ formula using floating point math. The distance formula is typically used to find the distance between two points and is:
dist = sqrt( (x1 - x2)^2 + (y1 - y2)^2 )
The math is done internally using floating point math to minimize roundoff. The end result is then rounded to the nearest integer.
The closest integer value after peforming the distance formula.
A floating point implementation of a square root function. The math is done using floats, but rounded after. Be warned, that for smaller values, the roundoff can be quite significant. The value of the sqrt of a negative number in this case is undefined.
The approximate square root of a value.