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/test/cmp.js

32 lines
665 B

4 years ago
'use strict'
var rat = require('../index')
var cmp = require('../cmp')
var sgn = require('signum')
var tape = require('tape')
tape('comparison - tiny integer', function(t) {
for(var i=-10; i<=10; ++i) {
for(var j=-10; j<=10; ++j) {
var x = rat(i)
var y = rat(j)
t.equals(cmp(x,y), sgn(i-j))
t.equals(x[0].toString(), ''+i)
t.equals(y[0].toString(), ''+j)
}
}
t.end()
})
tape('comparison - random floats', function(t) {
for(var i=0; i<100; ++i) {
var x = Math.random()
var y = Math.random()
var a = rat(x)
var b = rat(y)
t.equals(cmp(a,b), sgn(x-y), 'compare:' + x + ' to ' + y)
}
t.end()
})