Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. @IBAction func equalitySignPressed(sender: UIButton) {
  2.  
  3. if stillTyping {
  4. secondOperand = currentInput
  5. }
  6.  
  7. dotIsPlaced = false
  8.  
  9. switch operationSign {
  10.  
  11. case "+":
  12. operateWithTwoOperands{$0 + $1}
  13.  
  14. case "-":
  15. operateWithTwoOperands{$0 - $1}
  16.  
  17. case "✕":
  18. operateWithTwoOperands{$0 * $1}
  19.  
  20. case "÷":
  21. operateWithTwoOperands{$0 / $1}
  22. default: break
  23.  
  24. }
  25. }
  26.  
  27. «÷» Operation.BinaryOperation (/, {$0 + «÷» + $1}, 1,
  28. | { $1 == 0.0 ? «Division by zero» : nil })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement