Implementation uses an approximation which avoids the sqrt execution and is therefore much more efficient. More infos are here: http://stackoverflow.com/a/12934750.