4 ms·
The only reason fixed-width integer types exist is more or less a hack/optimization for doing fast and space-efficient integral math. Since these are total non
by pwdisswordfish9 4y ago
The only reason fixed-width integer types exist is more or less a hack/optimization for doing fast and space-efficient integral math. Since these are total non-issues for the problem domain where version numbers are involved, there's no reason not to use a bignum instead, if available.
Similar test: which is a more appropriate data type for ZIP codes, int or string?
- phoe-krk 4y agoObviously it's int, so you can do stuff like int zip_code = 01918 in C and then wonder why it doesn't even compile. /s
- oogali 4y agoWhen you say ZIP, do you mean USPS ZIP? USPS ZIP+4? Or non-US postal codes? Or all of the above?
- atoav 4y agoNon US ZIPs regularily have strings in them (e.g. Dutch ZIP codes) so a string would be appropriate.
- pwdisswordfish9 4y agoThis is half right. String would be more appropriate than an integer type even if that weren't true. ZIP codes really don't have anything to do with the fundamental numerical operations that are defined for integer types.
- dariusj18 4y agoplus zip codes can start with "0". Excel always screws this up