Configring node js.

This commit is contained in:
Vahagn Khachatryan
2018-12-07 15:58:35 +00:00
parent eef20e4bdd
commit 4fa4328740
1501 changed files with 87070 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
// 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 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;
}
});