[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#822221: ITP: flipcoin -- flip an adjustable coin for random exit status



* Anthony DeRobertis <anthony@derobert.net>, 2016-04-22, 09:09:
memset(&maxInt, 0xff, sizeof(maxInt));
"maxInt = -1" is would be a more obvious way to write it, IMHO.
Both pale in comparison to UINT32_MAX, also found in <stdint.h>.

Meh. The advantage of the existing code is that it doesn't repeat the size of valInt/maxInt anywhere. If you were going to give op on this nice property, you might as well get rid of maxInt completely, and instead of:

((double) maxInt)+1.0

write:

0x1P32


Reply to: