comparison of switch and if/else statement, same equation