Sha256: 99ceb3f730fafb742d1b8db2fe6d7a8a0108ca08ad70dab852e2806f6351d8d0

Contents?: true

Size: 680 Bytes

Versions: 34

Compression:

Stored size: 680 Bytes

Contents

// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
var $export = require('./$.export')
  , abs     = Math.abs;

$export($export.S, 'Math', {
  hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars
    var sum   = 0
      , i     = 0
      , $$    = arguments
      , $$len = $$.length
      , larg  = 0
      , arg, div;
    while(i < $$len){
      arg = abs($$[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 * Math.sqrt(sum);
  }
});

Version data entries

34 entries across 17 versions & 7 rubygems

Version Path
ilog-0.4.1 node_modules/core-js/modules/es6.math.hypot.js
ilog-0.4.1 node_modules/core-js/library/modules/es6.math.hypot.js
ilog-0.4.0 node_modules/core-js/modules/es6.math.hypot.js
ilog-0.4.0 node_modules/core-js/library/modules/es6.math.hypot.js
ilog-0.3.3 node_modules/core-js/modules/es6.math.hypot.js
ilog-0.3.3 node_modules/core-js/library/modules/es6.math.hypot.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/fbjs/node_modules/core-js/library/modules/es6.math.hypot.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/fbjs/node_modules/core-js/modules/es6.math.hypot.js
locomotivecms-3.4.0 app/javascript/node_modules/fbjs/node_modules/core-js/library/modules/es6.math.hypot.js
locomotivecms-3.4.0 app/javascript/node_modules/fbjs/node_modules/core-js/modules/es6.math.hypot.js
cortex-0.1.3 spec/dummy/node_modules/fbjs/node_modules/core-js/library/modules/es6.math.hypot.js
cortex-0.1.3 spec/dummy/node_modules/fbjs/node_modules/core-js/modules/es6.math.hypot.js
lanes-0.8.0 node_modules/core-js/library/modules/es6.math.hypot.js
lanes-0.8.0 node_modules/core-js/modules/es6.math.hypot.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/core-js/library/modules/es6.math.hypot.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/core-js/modules/es6.math.hypot.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/core-js/library/modules/es6.math.hypot.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/core-js/modules/es6.math.hypot.js
babel-schmooze-sprockets-0.1.3 node_modules/core-js/modules/es6.math.hypot.js
babel-schmooze-sprockets-0.1.3 node_modules/core-js/library/modules/es6.math.hypot.js