initial commit
This commit is contained in:
15
node_modules/almost-equal/test/test.js
generated
vendored
Normal file
15
node_modules/almost-equal/test/test.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
var almostEqual = require("../almost_equal.js")
|
||||
|
||||
require("tap").test("almost-equal", function(t) {
|
||||
|
||||
var a = 100
|
||||
, b = 100 + 1e-12
|
||||
|
||||
//Check if a == b up to float precision
|
||||
t.assert(almostEqual(a, b, almostEqual.FLT_EPSILON, almostEqual.FLT_EPSILON))
|
||||
|
||||
//Check if a == b up to double precision
|
||||
t.assert(!almostEqual(a, b, almostEqual.DBL_EPSILON, almostEqual.DBL_EPSILON))
|
||||
|
||||
t.end()
|
||||
})
|
||||
Reference in New Issue
Block a user