Skip to content

Commit cfb18ef

Browse files
committed
Revert "Merge pull request #1818 from jawj/master"
This reverts commit a571690, reversing changes made to be486a2.
1 parent b0f0d6f commit cfb18ef

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

underscore.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,15 +1203,12 @@
12031203
};
12041204

12051205
// Return a random integer between min and max (inclusive).
1206-
// Note the subtraction of 1e-16, to prevent a very occasional error where we'd
1207-
// return max + 1 due to rounding (see
1208-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)
12091206
_.random = function(min, max) {
12101207
if (max == null) {
12111208
max = min;
12121209
min = 0;
12131210
}
1214-
return min + Math.floor(Math.random() * (max - min + 1 - 1e-16));
1211+
return min + Math.floor(Math.random() * (max - min + 1));
12151212
};
12161213

12171214
// A (possibly faster) way to get the current timestamp as an integer.

0 commit comments

Comments
 (0)