View Single Post
  #101   Report Post  
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.cad
Martin Brown Martin Brown is offline
external usenet poster
 
Posts: 2,701
Default There IS Justice

On 29/11/2010 15:16, F. Bertolazzi wrote:
flipper:


Well, not quite.The code, as it stood, could handle, as of 2000, the
"past 100 years." That was the problem, there was no 'future' to it
after 2000.


There is. Suppose a mortgage has been started in 1993 and finishes in 2013.
It will last for 13-93=-80. It's negative, so you add 100. -80+100=20
years.


That works OK for mortgage intervals, but leaves you with an ambiguity
where absolute dates are concerned. In particular the lazy habit of
concatenating the string "19" in front of YY goes badly wrong when YY
becomes 100. USNO website scripts had this problem showing the rather
bizarre leap into the future "19100" instead of "2000".

Such things occurring in an embedded system where the destination buffer
is 4 bytes long can have very unpredictable results.

Another mortgage starts in 2001 and ends in 2021. 21-1=20, it is positive
so you don't add anything, and that's your mortgage duration.

The only problem is for events lasting more than 100 years (maybe there's
still somebody around born in the XIX century), but in that case the year
would have been 4 digits long anyway.


Not true. It may be the only part of the problem that you understand,
but there were a whole raft of other things capable of going wrong.
Mostly to do with datestamps on historical data and making sure that
programs could cope with all the original data and the revised post Y2k
format as well. Stuff that was mission critical was done and tested in
good time, but they still kept key engineers dry and on standby for the
Y2k rollover. It was the fact that 2000 *is* a leap year whereas 1900 is
not that caused the most grief to bank customers when some banks got it
right and others did not. Japan took quite a hit on Y2k2.

http://news.bbc.co.uk/1/hi/world/asi...fic/660953.stm

There was a lot of damage to NZ aluminium smelters due to leap year
incompatibility. It beggars belief that anyone could get it so wrong.

http://catless.ncl.ac.uk/Risks/18.74.html#subj5

Also look at the next one down for an example of daft Y2k faults that
banks were happy to keep running with.

Regards,
Martin Brown