]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/vim-mode/node_modules/grim/node_modules/emissary/node_modules/es6-weak-map/node_modules/es5-ext/math/fround/shim.js
f2c86e46a41c7af73e8e6b9923fff03a81ef7b67
1 // Credit: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js
7 if (typeof Float32Array
!== 'undefined') {
8 toFloat32
= (function () {
9 var float32Array
= new Float32Array(1);
12 return float32Array
[0];
16 toFloat32
= (function () {
17 var pack
= require('../_pack-ieee754')
18 , unpack
= require('../_unpack-ieee754');
21 return unpack(pack(x
, 8, 23), 8, 23);
26 module
.exports = function (x
) {
27 if (isNaN(x
)) return NaN
;
29 if (x
=== 0) return x
;
30 if (!isFinite(x
)) return x
;