UNPKG

double-double

Version:

Pure double-double precision functions *with strict error bounds*.

21 lines (15 loc) 770 B
import { expect } from 'chai'; import { describe } from 'mocha'; import { ddNegativeOf } from '../../../src/index.js'; describe('ddNegativeOf', function() { it('should correctly return the negative of some double-double precision values', function() { // Some double-doubles let a = [-4.357806199228875e-10, 11_638_607.274152497]; let b = [8.661162134715461e-10, 9_722_431.969870245]; let c = [4.511949494578893e-11, -2_797_357.2918064594]; expect(ddNegativeOf(a)).to.eql([4.357806199228875e-10, -11638607.274152497]); expect(ddNegativeOf(b)).to.eql([-8.661162134715461e-10, -9722431.969870245]); expect(ddNegativeOf(c)).to.eql([-4.511949494578893e-11, 2797357.2918064594]); }); });