Closed LeeYiyuan closed 2 years ago
When adding two big integers, it seems that there is some rounding that is taking place unintentionally.
Test code:
// Node v12.22.8, big-integer v1.6.51 const bi = require("big-integer"); console.log(bi("0")); > Integer { value: 0n } console.log(bi("98765432112345678"))); > Integer { value: 98765432112345678n } console.log(bi("0") + bi("98765432112345678")); > 98765432112345680
Perhaps I am missing something...
Figured it out -- use .add instead of operators as mentioned in the README. Sorry for the alarm.
.add
When adding two big integers, it seems that there is some rounding that is taking place unintentionally.
Test code:
Perhaps I am missing something...