Javatpoint Logo
Javatpoint Logo

Arithmetic Operators

Swift 4 supports the four standard arithmetic operators of all number types:

  • Addition (+) Operator
  • Subtraction (-) Operator
  • Multiplication (*) Operator
  • Division (/) Operator

Swift 4 arithmetic operators don't allow values to overflow by default (like the arithmetic operators in C and Objective-C language do).

In Swift 4, we can opt in to value overflow behavior by using Swift's overflow operators (such as a &+ b).

We can also use addition operator for String concatenation:

Next TopicRemainder Operator





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA