namespace FloatingPointEquality { function epsilonEqual ( a , b ) { return Math . abs ( a - b ) <= Number . EPSILON ; } console . log ( 0.1 + 0.1 + 0.1 == 0.3 ) ; console . log ( epsilonEqual ( 0.1 + 0.1 + 0.1 , 0.3 ) ) ; }