Sha256: bc18be6897d6db8468fa0ad5d49688795f30d8a9f734943a6e00311eb676f09d

Contents?: true

Size: 711 Bytes

Versions: 62

Compression:

Stored size: 711 Bytes

Contents

/* */ 
var $def = require('./$.def'),
    sign = require('./$.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;
};
$def($def.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;
  }});

Version data entries

62 entries across 31 versions & 1 rubygems

Version Path
sequenceserver-1.1.0.beta12 public/vendor/npm/core-js@1.1.2/library/modules/es6.math.fround.js
sequenceserver-1.1.0.beta12 public/vendor/npm/core-js@1.1.2/modules/es6.math.fround.js
sequenceserver-1.1.0.beta11 public/vendor/npm/core-js@1.1.2/modules/es6.math.fround.js
sequenceserver-1.1.0.beta11 public/vendor/npm/core-js@1.1.2/library/modules/es6.math.fround.js
sequenceserver-1.1.0.beta10 public/vendor/npm/core-js@1.1.2/library/modules/es6.math.fround.js
sequenceserver-1.1.0.beta10 public/vendor/npm/core-js@1.1.2/modules/es6.math.fround.js
sequenceserver-1.1.0.beta8 public/vendor/npm/core-js@1.1.2/modules/es6.math.fround.js
sequenceserver-1.1.0.beta8 public/vendor/npm/core-js@1.1.2/library/modules/es6.math.fround.js
sequenceserver-1.1.0.beta7 public/vendor/npm/core-js@1.1.2/library/modules/es6.math.fround.js
sequenceserver-1.1.0.beta7 public/vendor/npm/core-js@1.1.2/modules/es6.math.fround.js
sequenceserver-1.1.0.beta6 public/vendor/npm/core-js@1.1.2/library/modules/es6.math.fround.js
sequenceserver-1.1.0.beta6 public/vendor/npm/core-js@1.1.2/modules/es6.math.fround.js
sequenceserver-1.1.0.beta5 public/vendor/npm/core-js@1.1.2/modules/es6.math.fround.js
sequenceserver-1.1.0.beta5 public/vendor/npm/core-js@1.1.2/library/modules/es6.math.fround.js
sequenceserver-1.1.0.beta4 public/vendor/npm/core-js@1.1.2/modules/es6.math.fround.js
sequenceserver-1.1.0.beta4 public/vendor/npm/core-js@1.1.2/library/modules/es6.math.fround.js
sequenceserver-1.1.0.beta3 public/vendor/npm/core-js@1.1.2/modules/es6.math.fround.js
sequenceserver-1.1.0.beta3 public/vendor/npm/core-js@1.1.2/library/modules/es6.math.fround.js
sequenceserver-1.1.0.beta2 public/vendor/npm/core-js@1.1.2/modules/es6.math.fround.js
sequenceserver-1.1.0.beta2 public/vendor/npm/core-js@1.1.2/library/modules/es6.math.fround.js