StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
StackGenVis/frontend/node_modules/big-rat/lib/bn-to-num.js

24 lines
420 B

4 years ago
'use strict'
var sign = require('./bn-sign')
module.exports = bn2num
//TODO: Make this better
function bn2num(b) {
var l = b.length
var words = b.words
var out = 0
if (l === 1) {
out = words[0]
} else if (l === 2) {
out = words[0] + (words[1] * 0x4000000)
} else {
for (var i = 0; i < l; i++) {
var w = words[i]
out += w * Math.pow(0x4000000, i)
}
}
return sign(b) * out
}