4 ms·
They were lucky that the software wasn't naively using an unsigned int, or the altitude would have read 4294966055 feet.
by pklausler 9y ago
They were lucky that the software wasn't naively using an unsigned int, or the altitude would have read 4294966055 feet.
- aaronmdjones 9y agoAssuming an unsigned int is 32 bits large. Never assume the size of an int; this is what uint8_t, int8_t, uint16_t, int16_t, etc are for. The only thing the standards say about the size of an int is that it must be at least as large as a short, which must be at least as large as a char, which must be 1 byte. Even then, 1 byte is not necessarily 8 bits (but it is in POSIX).