Ian
Ian

Reputation: 685

Overflow division operator '&/' not recognized

The following playground results in an error:

1 &/ 0 

Errors:

Operator is not known binary operator
Use of unresolved identifier '&/'

Documentation says it should return 0

Running xCode: Version 6.3.1 (6D1002)

Any thoughts?

Upvotes: 0

Views: 171

Answers (1)

Airspeed Velocity
Airspeed Velocity

Reputation: 40955

&/ and &% were removed in Xcode 6.3.

Per the release notes:

Unlike the &+, &-, and &* operators, these operators did not provide two’s-complement arithmetic behavior; they provided special case behavior for division, remainder by zero, and Int.min/-1. These tests should be written explicitly in the code as comparisons if needed.

Upvotes: 5

Related Questions