mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-12-01 12:24:05 +01:00
Merge pull request #22 from QuantumThom/patch-2
Update CalculatorBrain.swift
This commit is contained in:
commit
b4546219da
1 file changed
+3
-1
@@ -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