This is really weird, why would dedicated command that calculates distance between 2 coordinates on the map inside the engine be slower than a bunch of SQF commands put together in the game??
Wait, this is not all. The accuracy of dedicated command is atrocious as well!!!
Mistery is solved!: http://killzonekid.com/arma-scripting-tutorials-distance/