Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: dayglored
You are correct, for anyone using signed 32 bit 2's compliment representation.

It wouldn't roll over to zero unless they were using unsigned, and that wouldn't roll over (for 32 bits) until 4 billion ticks and change.

15 posted on 01/03/2016 6:14:21 PM PST by ThunderSleeps (Stop obarma now! Stop the hussein - insane agenda!)
[ Post Reply | Private Reply | To 12 | View Replies ]


To: ThunderSleeps
> You are correct, for anyone using signed 32 bit 2's compliment representation. It wouldn't roll over to zero unless they were using unsigned, and that wouldn't roll over (for 32 bits) until 4 billion ticks and change.

Yep. The problems with "simply" going to an unsigned representation, however, include:

  1. Incompatibility with all other software and filesystems that use the time_t signed int representation, and
  2. Inability to represent dates prior to 1970.
Those are likely not problems for, say, an embedded system which doesn't deal with dates before 1970 and doesn't interact with any other software that would interpret values in the "upper half" of the unsigned int range as "negative". But that's a relatively small percentage of systems.
19 posted on 01/03/2016 6:48:30 PM PST by dayglored ("Listen. Strange women lying in ponds distributing swords is no basis for a system of government.")
[ Post Reply | Private Reply | To 15 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson