diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/core-js/modules/es6.math.fround.js | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/core-js/modules/es6.math.fround.js')
-rw-r--r-- | node_modules/core-js/modules/es6.math.fround.js | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/node_modules/core-js/modules/es6.math.fround.js b/node_modules/core-js/modules/es6.math.fround.js index 01a88862e..9c262f2ec 100644 --- a/node_modules/core-js/modules/es6.math.fround.js +++ b/node_modules/core-js/modules/es6.math.fround.js @@ -1,26 +1,4 @@ // 20.2.2.16 Math.fround(x) -var $export = require('./_export') - , sign = require('./_math-sign') - , pow = Math.pow - , EPSILON = pow(2, -52) - , EPSILON32 = pow(2, -23) - , MAX32 = pow(2, 127) * (2 - EPSILON32) - , MIN32 = pow(2, -126); +var $export = require('./_export'); -var roundTiesToEven = function(n){ - return n + 1 / EPSILON - 1 / EPSILON; -}; - - -$export($export.S, 'Math', { - fround: function fround(x){ - var $abs = Math.abs(x) - , $sign = sign(x) - , a, result; - if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; - a = (1 + EPSILON32 / EPSILON) * $abs; - result = a - (a - $abs); - if(result > MAX32 || result != result)return $sign * Infinity; - return $sign * result; - } -});
\ No newline at end of file +$export($export.S, 'Math', { fround: require('./_math-fround') }); |