O'Reilly logo

Objective-C Quick Syntax Reference by Matthew Campbell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 4

image

Operators

Operators Defined

Operators are used to perform operations on values. You can do arithmetic, assignment, logical, and relational operations with operators.

Arithmetic Operators

Arithmetic operators are used to perform math on values. You can use arithmetic operators to perform addition, subtraction, multiplication, division, and modulus (the remainder from a division operation). Table 4-1 lists Objective-C’s arithmetic operators.

Table 4-1. Arithmetic Operators

Operator

Meaning

+

Addition

-

Subtraction

*

Multiplication

/

Division

%

Modulus

An operation will look like a math problem.

1.0 + 2.0 – 3.0 * 4.0 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required