mirror of
https://github.com/MikeMcl/decimal.js.git
synced 2026-09-23 12:24:47 +00:00
#217 Compute acos with less cancellation near x=1
This commit is contained in:
committed by
Michael Mclaughlin
parent
7f01abd83d
commit
08e5a381d2
26
test/hypothesis/evaluate.mjs
Normal file
26
test/hypothesis/evaluate.mjs
Normal file
@@ -0,0 +1,26 @@
|
||||
// listen for test cases, and provide the results.
|
||||
// give JSON of the test case, receive the result
|
||||
// Example:
|
||||
// > {"func":"tan", "args":["12.5"], "config":{"precision":8}}
|
||||
// -0.066468242
|
||||
|
||||
|
||||
import {Decimal} from '../../decimal.mjs';
|
||||
import {createInterface} from 'readline';
|
||||
|
||||
const readline = createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
});
|
||||
|
||||
readline.on("close", () => {console.log('\n'); process.exit(0);});
|
||||
|
||||
readline.on("line", (line) => {
|
||||
if (line) {
|
||||
const {func, args, config} = JSON.parse(line);
|
||||
config.defaults = true;
|
||||
Decimal.set(config);
|
||||
const result = Decimal[func](...args);
|
||||
console.log(result);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user