4 Arithmetic Operators in Swift

Опубликовано: 02 Март 2026
на канале: Shiko Matlala
18
0

Swift supports the four standard arithmetic operators for all number types:
Addition (+)
Subtraction (-)
Multiplication (*)
Division (/)

Unlike the arithmetic operators in C and Objective-C, the Swift arithmetic operators don’t allow values to overflow by default. You can opt in to value overflow behavior by using Swift’s overflow operators (such as a &+ b). See Overflow Operators.

https://docs.swift.org/swift-book/Lan...