Linked by Thom Holwerda on Mon 24th Sep 2012 15:07 UTC, submitted by MOS6510
General Development "I've been programming professionally for about 3 years at this point, and I've noticed some interesting patterns in other programmers I've worked with. One of the key differentiators among programmers is motivation. I'm not referring to an individual's passion to simply be successful in their career, but rather the type of work they want to pursue. The thing they want to do with computers every day, the types of problems they are interested in solving."
Thread beginning with comment 536414
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: Sad Truth
by renox on Tue 25th Sep 2012 12:51 UTC in reply to "Sad Truth"
Member since:

In case anyone is curious, this one liner function gives you the absolute value of some 32-bit integer 'num':
"int myAbs(const int num) { return num < 0 ? (~num) + 1 : num; }

Big fail!, what about INT_MIN?
The absolute value of a 32-bit integer needs to be given on a >32bit integer type.

Reply Parent Score: 3

RE[2]: Sad Truth
by JeeperMate on Tue 25th Sep 2012 13:01 in reply to "RE: Sad Truth"
JeeperMate Member since:

Well, you've done your homework.

Reply Parent Score: 0

RE[3]: Sad Truth
by phreck on Tue 25th Sep 2012 14:49 in reply to "RE[2]: Sad Truth"
phreck Member since:

Now finally come down from your wannabe-teacher-trip, because you haven't done "your homework". Relying on fixed bit patterns when using types of unknown size is outright dangerous and leads to stuff that kills space rockets.

Reply Parent Score: 2