Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
cortex42997yIn a for loop it is. But look at the following example:
int a=0; int b=++a; //a=1, b=1
int a=0; int b=a++; //a=1, b=0 -
@simus Ariane5 July 1996:
The on-board computer crashed 36.7 sec. after the start when he tried to convert the horizontal speed value of 64 bit floating point representation to 16 bit signed integer: -+ b1 b1 b2... b15.
The corresponding number was greater than 2^{15}=32768 and created an overflow.
The steering system collapsed and gave up control to a second, identical unit. Self-destruct was triggered because the engines threatened to break off. -
simus2467y
-
@simus btw:
ariane5: loss approx. $500 million for rockets and satellites. Development costs approx. 7 billion dollars.
There are dozens of examples:
Pentium processor division error 1994
Patriot missile error 1991
Loss of the Mars Climate Orbiter 1998
The Denver Case Debacle
Venus Mariner 1 is lost on the way in 1962
US Federal Reserve System
Bank of America
Worth a look: https://translate.google.de/transla... -
ddephor45117yC operator precedence and evaluation order fun:
i=0, i+++i = 1
i=0, i+ ++i = 2
i=0, i++ +i = 1
i=0, i++ + ++i = 2
i=0, i+++ ++i = 2
i=0, ++i+ ++i = 4
i=0, ++i+ i++ = 3
i=0, ++i+i++ = 3
And it can be continued forever:
i=0, ++i+i+++i+++i+++i+++i+++i+++i+++i+++i+++i+++i+++i+++i+++i+++i+++i+++i+++i+++i++ = 192
i++;
++i;
It's the same shit
undefined