Closed nikelborm closed 3 years ago
{
k: 30,
base: 1073741824,
less: 1073741822,
more: 1073741826,
strBase: '1073741824',
strLess: '1073741822',
strMore: '1073741826',
baseTilda: 1073741824,
lessTilda: 1073741822,
moreTilda: 1073741826,
basePlus: 1073741824,
lessPlus: 1073741822,
morePlus: 1073741826
}
{
k: 31,
base: 2147483648,
less: 2147483646,
more: 2147483650,
strBase: '2147483648',
strLess: '2147483646',
strMore: '2147483650',
baseTilda: -2147483648,
lessTilda: 2147483646,
moreTilda: -2147483646,
basePlus: 2147483648,
lessPlus: 2147483646,
morePlus: 2147483650
}
{
k: 32,
base: 4294967296,
less: 4294967294,
more: 4294967298,
strBase: '4294967296',
strLess: '4294967294',
strMore: '4294967298',
baseTilda: 0,
lessTilda: -2,
moreTilda: 2,
basePlus: 4294967296,
lessPlus: 4294967294,
morePlus: 4294967298
}
{
k: 33,
base: 8589934592,
less: 8589934590,
more: 8589934594,
strBase: '8589934592',
strLess: '8589934590',
strMore: '8589934594',
baseTilda: 0,
lessTilda: -2,
moreTilda: 2,
basePlus: 8589934592,
lessPlus: 8589934590,
morePlus: 8589934594
}
it works only for integers up to 2^31-1. for larger integers use bigint
to expand on this, bitwise operations on the Number type truncate to 32 bits. bitwise operations on the BigInt type do not.
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
What is the expected behavior?
What do you see instead?
Additional information