3 ms·
> So, is it now perfect? Well, sort of. We now have introduced a certain asymmetry into our number system I think some systems use the INT_MIN bit pattern as a
by nayuki 3y ago
> So, is it now perfect? Well, sort of. We now have introduced a certain asymmetry into our number system
I think some systems use the INT_MIN bit pattern as a sort of not-a-number integer trap?
- masswerk 3y agoI think, it's more an aesthetic than a technical annoyance. But, since there was ones' compliment first (implemented in about every early computer), it may be worth mentioning that there was something lost, as well. (So, for a byte, the range is now -128…+127, which isn't that pretty, while it had been -127…+127 with ones' complement.) You may be right about NaN representation, but I don't know for certain. Notably, negative zero lived on in scientific computing, and you can have it even in JS, if you set the language version to "1.2". (Edit/Correction: setting the type to "javascript1.2" no longer works, all versions are now synonymous with just plain "javascript".)