MCPcopy Index your code
hub / github.com/plotly/plotly.js / num2bn

Function num2bn

stackgl_modules/index.js:2350–2357  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

2348module.exports = num2bn
2349
2350function num2bn(x) {
2351 var e = db.exponent(x)
2352 if(e < 52) {
2353 return new BN(x)
2354 } else {
2355 return (new BN(x * Math.pow(2, 52-e))).ushln(e-52)
2356 }
2357}
2358
2359
2360/***/ }),

Callers 2

makeRationalFunction · 0.85
rationalizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…