GoogleChromeLabs / jsbi

JSBI is a pure-JavaScript implementation of the official ECMAScript BigInt proposal.

Home Page:https://v8.dev/features/bigint#polyfilling-transpiling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README.md typo

munizart opened this issue · comments

commented

It says on line 62 Modulus where it should be read as Remainder, as there isn't a modulus operator in JS.
Please note that remainder and modulus may seem to be idempotent, but it's only true over natural numbers, for integers modulus differ from remainder when dividend is negative.
Ex:

-3 % 4 === -3
modulus(-3, 4) === 1

I would open a PR, but i ain't willing to sign a CLA.

Thanks,

For future reference, this is about the following line:

| Modulus                     | `c = a % b`    | `c = a.remainder(b)`      |

For the record, the operation is actually neither modulus nor remainder, and a better term has not been found. See discussion in tc39/proposal-bigint#37. That said, I'm fine with changing that word in the readme to "Remainder".