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
-- Hui Zhou -- http://linuxfromscratch.org/mailman/listinfo/lfs-chat FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page
