Double variables can ' t ▁ be ▁ checked ▁ precisely ▁ ▁ using ▁ ' == ' this function returns true if  the double variables are equal
function compareDoubles ( A , B ) { var diff = A - B ; return diff < EPSILON && - diff < EPSILON ; }