Use a branch instead of math on enum types