MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / printIdentityTable

Function printIdentityTable

test/big-decimal/comprehensive-benchmark.ts:506–522  ·  view source on GitHub ↗
(results: IdentityResult[])

Source from the content-addressed store, hash-verified

504}
505
506function printIdentityTable(results: IdentityResult[]) {
507 console.log(
508 ` ${'Identity'.padEnd(35)} ${'Prec'.padStart(5)} ${'BD digits'.padStart(10)} ${'DJ digits'.padStart(10)}`
509 );
510 console.log(
511 ` ${'─'.repeat(35)} ${'─'.repeat(5)} ${'─'.repeat(10)} ${'─'.repeat(10)}`
512 );
513 for (const r of results) {
514 const bdStr = r.bdCorrectDigits === Infinity ? '∞ (exact)' :
515 r.bdCorrectDigits >= r.precision ? `${r.bdCorrectDigits} ✓` : `${r.bdCorrectDigits}`;
516 const djStr = r.djCorrectDigits === Infinity ? '∞ (exact)' :
517 r.djCorrectDigits >= r.precision ? `${r.djCorrectDigits} ✓` : `${r.djCorrectDigits}`;
518 console.log(
519 ` ${r.name.padEnd(35)} ${String(r.precision).padStart(5)} ${bdStr.padStart(10)} ${djStr.padStart(10)}`
520 );
521 }
522}
523
524for (const prec of [50, 100, 500]) {
525 console.log(`\n ── Precision: ${prec} ──`);

Callers 1

Calls 1

logMethod · 0.65

Tested by

no test coverage detected