(results: IdentityResult[])
| 504 | } |
| 505 | |
| 506 | function 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 | |
| 524 | for (const prec of [50, 100, 500]) { |
| 525 | console.log(`\n ── Precision: ${prec} ──`); |
no test coverage detected