math: cleanup: make handling binops a switch() statement