Name: Anonymous 2011-06-27 18:27
I know a guy that says you should replace every conditional with a switch.
switch (x) {
case -1:
case -2:
case -3:
case -4
case -5
case -6
case -7
case -8:
case -9:
case -10:
case -11:
case -12: //lol i bet it can't be less than this
result = 0
break;
default:
result = sqrt(x);
}
if (x < 0)
result = 0;
else
result = sqrt(x);