mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-03-31 22:43:28 +02:00
Merge pull request #22 from QuantumThom/patch-2
Update CalculatorBrain.swift
This commit is contained in:
@@ -33,7 +33,9 @@ struct CalculatorBrain {
|
|||||||
"÷" : Operation.binary({ $0 / $1 }),
|
"÷" : Operation.binary({ $0 / $1 }),
|
||||||
"+" : Operation.binary({ $0 + $1 }),
|
"+" : Operation.binary({ $0 + $1 }),
|
||||||
"−" : Operation.binary({ $0 - $1 }),
|
"−" : Operation.binary({ $0 - $1 }),
|
||||||
"=" : Operation.equals
|
"=" : Operation.equals,
|
||||||
|
"%" : Operation.binary({$0.truncatingRemainder(dividingBy: $1)}),
|
||||||
|
"AC" : Operation.constant(0)
|
||||||
]
|
]
|
||||||
|
|
||||||
mutating func performOperation(_ symbol: String) {
|
mutating func performOperation(_ symbol: String) {
|
||||||
|
|||||||
Reference in New Issue
Block a user