BVB Source Codes

reactide Show es6.math.fround.js Source code

Return Download reactide: download es6.math.fround.js Source code - Download reactide Source code - Type:.js
  1. // 20.2.2.16 Math.fround(x)
  2. var $export   = require('./_export')
  3.   , sign      = require('./_math-sign')
  4.   , pow       = Math.pow
  5.   , EPSILON   = pow(2, -52)
  6.   , EPSILON32 = pow(2, -23)
  7.   , MAX32     = pow(2, 127) * (2 - EPSILON32)
  8.   , MIN32     = pow(2, -126);
  9.  
  10. var roundTiesToEven = function(n){
  11.   return n + 1 / EPSILON - 1 / EPSILON;
  12. };
  13.  
  14.  
  15. $export($export.S, 'Math', {
  16.   fround: function fround(x){
  17.     var $abs  = Math.abs(x)
  18.       , $sign = sign(x)
  19.       , a, result;
  20.     if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
  21.     a = (1 + EPSILON32 / EPSILON) * $abs;
  22.     result = a - (a - $abs);
  23.     if(result > MAX32 || result != result)return $sign * Infinity;
  24.     return $sign * result;
  25.   }
  26. });
downloades6.math.fround.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top