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

To: ShadowAce
I can't believe nobody caught this:
> ...the Unix time counter overflows the limits of the 32-bit integer data type (at 2,147,483,647 seconds). Time will just rollover to 0 and start again.
NO IT WON'T. The integer is SIGNED, meaning the "time" will jump to the negative limit of the 32-bit two's-complement, which is roughly the evening of Dec 13, 1901. It won't be Jan 1, 1970 for another 69 years.

Right?

12 posted on 01/03/2016 5:51:23 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 1 | View Replies ]


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: dayglored
I was just checking on your assertion and found this integer roll over problem on Wikipedia. Whoopsie!
On 30 April 2015, the Federal Aviation Authority announced it will order Boeing 787 operators to reset its electrical system periodically, to avoid an integer overflow which could lead to loss of electrical power and ram air turbine deployment, and Boeing is going to deploy a software update in the fourth quarter.[11] The European Aviation Safety Agency followed on 4 May 2015.[12] The error happens after 2³¹ centiseconds (248.55134814815 days), indicating a 32 bit signed integer.

11. "F.A.A. Orders Fix for Possible Power Loss in Boeing 787". New York Times. 30 April 2015.

That's every 8 months! On a brand new aircraft! You'd think the flight software guys would be aware of simple problems like this by now. "Captain, when did we last reboot the flight computers?"

16 posted on 01/03/2016 6:20:25 PM PST by ProtectOurFreedom (For those who understand, no explanation is needed. For those who do not, no explanation is possible)
[ Post Reply | Private Reply | To 12 | 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