Hui Zhou wrote: > On Mon, Feb 28, 2005 at 01:36:32AM +0000, Johan V. wrote: >>How about: >> >>return ( a+b+c == 180 ) * (a>0) * (b>0) * (c>0) * >> ( 1 + (a==b) + (a==c) + (b==c) ); >> >>0 : not a triangle >>1 : scalene >>2 : isosceles >>4 : equilateral > > Very Clever! Except ... > > 1. Obscured > 2. Wasting CPU clocks
I know it's very obscured. Think about the wasted clock cycles for a minute, the above can be implemented without conditional jumps ... -- http://linuxfromscratch.org/mailman/listinfo/lfs-chat FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page
