Skip to content

Commit deb2e82

Browse files
committed
Other: Commented out float assertions in float test including explanation
1 parent d3ebd57 commit deb2e82

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/float.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ var protobuf = require("..");
88

99
tape.test("floats", function(test) {
1010

11-
test.equal(1.401298464324817e-45, Math.pow(2, -149), "literal 2^-149 should match calculated");
12-
test.equal(5e-324, Math.pow(2, -1074), "literal 2^-1074 should match calculated");
11+
// The following assertions were meant to validate that using float literals instead of pre-calculated
12+
// vars is safe. Turned out that these tests pass on all platforms except Edge 13/14 (which doesn't even
13+
// use the float fallback), where it failed because of the complete opposite: Math.pow(2, -1074) => 0
14+
15+
// test.equal(1.401298464324817e-45, Math.pow(2, -149), "literal 2^-149 should match calculated");
16+
// test.equal(5e-324, Math.pow(2, -1074), "literal 2^-1074 should match calculated");
1317

1418
var common = [
1519
0,

0 commit comments

Comments
 (0)