Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @IBAction func equalitySignPressed(sender: UIButton) {
- if stillTyping {
- secondOperand = currentInput
- }
- dotIsPlaced = false
- switch operationSign {
- case "+":
- operateWithTwoOperands{$0 + $1}
- case "-":
- operateWithTwoOperands{$0 - $1}
- case "✕":
- operateWithTwoOperands{$0 * $1}
- case "÷":
- operateWithTwoOperands{$0 / $1}
- default: break
- }
- }
- «÷» Operation.BinaryOperation (/, {$0 + «÷» + $1}, 1,
- | { $1 == 0.0 ? «Division by zero» : nil })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement