Follow

You don't know

This code produces "true":
((2147483647 + (1024 * 1024 * 1024 * 8)) | 0) == 2147483647

@alexcleac
hm, that's 31.. so the 32th bit is a type bit? It says whether this is an int or an object pointer?

@Wolf480pl it may be 🤔I didn't think deep to understand, why 31 and not 32, I am trying to find the source of collision I've been experiencing at work :)

@alexcleac @Wolf480pl
Replace |0 with &0xffffffff and it is also true in Python. |0 coerces to int32

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either! We adhere to an adapted version of the TootCat Code of Conduct and have documented a list of blocked instances. Ash is the admin and is supported by Fuzzface, Brian!, and Daniel Glus as moderators. Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!