-
-
Notifications
You must be signed in to change notification settings - Fork 4
overflow
Pannous edited this page Sep 22, 2021
·
1 revision
In the primitive number type as well as in its lightweight wrapper class Number, numbers get automatically upgraded: if you multiply two int8 (bytes) you may get an int16, if you multiply two int60 you may get a bignum (which may or may not be different to javascripts bignum).
In rare situations where developers interact with primitive types directly overflow appears as following:
The 4 extra bits of int60 handle sign ±infinity nan/undefined and overflow. overflow is useful because an overflow number is still comparible: infinity < overflow < max-int.