(Untitled)

Aug 25, 2006 11:25

Software Engineering lesson 7:

"Greater than or equal to" is not the same operation as "Greater than" with a slightly different value (for floating point numbers). More specifically, if I have the statement "ColumnA is valid if it is greater than or equal to 150", it should not be implemented as "ColumnA > 149.9".

Leave a comment

Comments 4

dragoni82 August 25 2006, 23:16:20 UTC
Heh. I found something, in looking over the code this week.
The long and the short of it:

unsigned int count = 640
[...]
while( count >= 0 ){...}

Please, please cry with me.

Reply

kennego August 26 2006, 04:22:31 UTC
Hahahaha

I mean, *sob*

Reply

feveredwritings August 26 2006, 15:29:12 UTC
anh_irrsinn says, "That's going to be problematic."

Reply

guyblade August 27 2006, 03:16:29 UTC
Clearly, the author of that code intended it to be stopped by the exception thrown when the int overflows.

Reply


Leave a comment

Up