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/example/example.js

24 lines
554 B

var rat = require('../index')
//Construct a pair of rational numbers;
// a = 1/10
// b = 2/10
var a = rat(1, 10)
var b = rat(2, 10)
//Compute their sum
var add = require('../add')
var c = add(a, b)
//Print out sum
var toString = require('../to-string')
console.log('a+b=', toString(c))
//And also convert to a number
var toFloat = require('../to-float')
console.log('exact rational result:', toFloat(c))
//For comparison, here is the same computation performed with floats
var x = 0.1
var y = 0.2
console.log('approximate float result:', x + y)