Sha256: fd74f798bf9aa1e63cf5581a8aeb3537b94a92a89975f23f782d70b6d0414bec

Contents?: true

Size: 888 Bytes

Versions: 24

Compression:

Stored size: 888 Bytes

Contents

var $ = require('../internals/export');

var $hypot = Math.hypot;
var abs = Math.abs;
var sqrt = Math.sqrt;

// Chrome 77 bug
// https://bugs.chromium.org/p/v8/issues/detail?id=9546
var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity;

// `Math.hypot` method
// https://tc39.github.io/ecma262/#sec-math.hypot
$({ target: 'Math', stat: true, forced: BUGGY }, {
  hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars
    var sum = 0;
    var i = 0;
    var aLen = arguments.length;
    var larg = 0;
    var arg, div;
    while (i < aLen) {
      arg = abs(arguments[i++]);
      if (larg < arg) {
        div = larg / arg;
        sum = sum * div * div + 1;
        larg = arg;
      } else if (arg > 0) {
        div = arg / larg;
        sum += div * div;
      } else sum += arg;
    }
    return larg === Infinity ? Infinity : larg * sqrt(sum);
  }
});

Version data entries

24 entries across 24 versions & 7 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/core-js/modules/es.math.hypot.js
disco_app-0.18.0 test/dummy/node_modules/core-js/modules/es.math.hypot.js
disco_app-0.18.2 test/dummy/node_modules/core-js/modules/es.math.hypot.js
tang-0.2.1 spec/tang_app/node_modules/core-js/modules/es.math.hypot.js
tang-0.2.0 spec/tang_app/node_modules/core-js/modules/es.math.hypot.js
tang-0.1.0 spec/tang_app/node_modules/core-js/modules/es.math.hypot.js
tang-0.0.9 spec/tang_app/node_modules/core-js/modules/es.math.hypot.js
enju_library-0.3.8 spec/dummy/node_modules/core-js/modules/es.math.hypot.js
condenser-0.3 lib/condenser/processors/node_modules/core-js-pure/modules/es.math.hypot.js
condenser-0.2 lib/condenser/processors/node_modules/core-js-pure/modules/es.math.hypot.js
condenser-0.1 lib/condenser/processors/node_modules/core-js-pure/modules/es.math.hypot.js
condenser-0.0.12 lib/condenser/processors/node_modules/core-js-pure/modules/es.math.hypot.js
condenser-0.0.11 lib/condenser/processors/node_modules/core-js-pure/modules/es.math.hypot.js
condenser-0.0.10 lib/condenser/processors/node_modules/core-js-pure/modules/es.math.hypot.js
condenser-0.0.9 lib/condenser/processors/node_modules/core-js-pure/modules/es.math.hypot.js
condenser-0.0.8 lib/condenser/processors/node_modules/core-js-pure/modules/es.math.hypot.js
jester-data-8.0.0 node_modules/core-js/modules/es.math.hypot.js
ezii-os-5.2.1 node_modules/core-js/modules/es.math.hypot.js
ezii-os-2.0.1 node_modules/core-js/modules/es.math.hypot.js
ezii-os-1.1.0 node_modules/core-js/modules/es.math.hypot.js