Help a C++ coder see the light

Dave Cole djc at object-craft.com.au
Fri Jan 31 06:37:22 CET 2003


>>>>> "Dennis" == Dennis Lee Bieber <wlfraed at ix.netcom.com> writes:

Dennis> Dave Cole fed this fish to the penguins on Thursday 30 January
Dennis> 2003 05:33 pm:

>> Worked 45.00 hours at $10.00 hourly rate.
-> wage (including overtime) is $262.50.
>>  What!!!  How can that be!!!  It passed through the compiler/linker
>> safety net.
>> 
Dennis>         I had to go back to spot that error -- I was blinded
Dennis> by "... TWO return statements? How ugly... How might I do
Dennis> it...

In Python rather than C?

Dennis>     return (hours * rate) + (max(0, hours - 37.5) * rate * 0.5)

Dennis> (obviously this formulation also corrected for the error <G>)

Yeah, and I bet you used the Intel compiler too!

- Dave

-- 
http://www.object-craft.com.au




More information about the Python-list mailing list