alchemy-2024-SWIFT

Operators

BODMAS Rule:

Bracket , Division, Multiplication, Addition and substraction

let width: Double = 7

width/2   // 3.5

Reminder


width % height

let wid:Double = 10
let hei:Double = 6


width.truncatingRemainder(dividingBy: height)

Compound assignment operator

var x=5
x=x+1
x +=1

Not operator

!(width < height)

Type casting

var a = 10
var b: Double = Double(a)