3 ms·
This should be titled "How Integers Should Work (In CPU architectures)". Programming languages have little to work with currently, and it is very inconsistent a
by tobiasu 15y ago
This should be titled "How Integers Should Work (In CPU architectures)". Programming languages have little to work with currently, and it is very inconsistent across architectures. Having an IEEE standard for integer math like we have for FP numbers could (...) help in the long term.
The only explicit "invalid" value I know of is available for floating point numbers. NULL in C is usually* not an invalid address, even if user-space programmers often seem to think so. Rather there are no pages mapped at that address and the kernel hands this page fault to user-space in some way. There is plenty of hardware where physical memory starts at 0x0. Lots of fun can be had debugging such a thing.
* IIRC there was a CPU architecture that interpreted "9" as an invalid address, but I can't remember what it was..?