summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2017-01-06 21:59:58 (EST)
committer P. J. McDermott <pj@pehjota.net>2017-01-06 21:59:58 (EST)
commiteac755d9997b7d7d0477b4d120329e29b5e53da8 (patch)
tree73ca0eac1ab6561d75b0f281b1ea456feb758357
parent06073f700d2b1c1c030f58e954b1f849fa54a1c2 (diff)
downloaddecmath.js-eac755d9997b7d7d0477b4d120329e29b5e53da8.zip
decmath.js-eac755d9997b7d7d0477b4d120329e29b5e53da8.tar.gz
decmath.js-eac755d9997b7d7d0477b4d120329e29b5e53da8.tar.bz2
test/10_dadd.js: Test adding 0.01 10000 times
-rw-r--r--test/10_dadd.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/10_dadd.js b/test/10_dadd.js
index e182ee2..c329a1a 100644
--- a/test/10_dadd.js
+++ b/test/10_dadd.js
@@ -55,4 +55,11 @@ describe("dadd()", function() {
assert.equal(dadd(test[0], test[1]), test[2]);
});
});
+ it("correctly adds 0.01 10000 times", function() {
+ var a = 0;
+ for (var i = 0; i < 10000; ++i) {
+ a = dadd(a, 0.01);
+ }
+ assert.equal(a, "100.00");
+ });
});