double-double
Version:
Pure double-double precision functions *with strict error bounds*.
26 lines (20 loc) • 508 B
text/typescript
import { expect } from 'chai';
import { describe } from 'mocha';
import { reduceSignificand } from '../../src/index.js';
describe('reduce significand', function() {
it('should reduce the significand of a double correctly',
function() {
{
let a = 218.125; // 218 + 1/8
expect(reduceSignificand(a, 11)).to.eql(
218.125
);
}
{
let a = 218.0625; // 218 + 1/16
expect(reduceSignificand(a, 11)).to.eql(
218
);
}
});
});