npub1tu…p9wu4 on Nostr: Okay. I'm going nuts: some math with very big numbers isn't consistent across ...
Okay. I'm going nuts: some math with very big numbers isn't consistent across languages.
What am I missing here?
In #Javascript:
(36342608503257322 % 4294967296) == 3993778408
In #OpenSCAD:
(36342608503257322 % 4294967296) == 3993778408
In #Python:
(36342608503257322 % 4294967296) == 3993778410
in #Ruby :
(36342608503257322 % 4294967296) == 3993778410
Can anyone explain why the result is off by 2?
Published at
2025-02-11 20:07:26 UTCEvent JSON
{
"id": "412c1b4e6b8de5283692022882348fb54e834badc593cc014ac8c79d292466d3",
"pubkey": "5f2dac217c35680cbce574baa0ae609373a356ef1de1ab2ed0a920abb9db3fff",
"created_at": 1739304446,
"kind": 1,
"tags": [
[
"t",
"openscad"
],
[
"proxy",
"https://fosstodon.org/@linux_mclinuxface/113987056191593792",
"web"
],
[
"t",
"ruby"
],
[
"t",
"javascript"
],
[
"t",
"python"
],
[
"proxy",
"https://fosstodon.org/users/linux_mclinuxface/statuses/113987056191593792",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://fosstodon.org/users/linux_mclinuxface/statuses/113987056191593792",
"pink.momostr"
],
[
"-"
]
],
"content": "Okay. I'm going nuts: some math with very big numbers isn't consistent across languages.\n\nWhat am I missing here?\n\nIn #Javascript: \n(36342608503257322 % 4294967296) == 3993778408 \n\nIn #OpenSCAD:\n(36342608503257322 % 4294967296) == 3993778408\n\nIn #Python:\n(36342608503257322 % 4294967296) == 3993778410\n\nin #Ruby :\n(36342608503257322 % 4294967296) == 3993778410\n\nCan anyone explain why the result is off by 2?",
"sig": "30ed2fc0cae2b16d4d44b754d9483af78f9fee4750651212ed129379466ac725a06070cf43741cf40704e1726ea93839b9fbd2ce1795160e09ede80e097811f3"
}