우리가 흔히 사용하는 %는 연산하려는 두 수가 모두 Int일 경우에만 사용 가능하다. Double 혹은 Float형은 어떻게 사용해야할까?
func truncatingRemainder(dividingBy other: Self) -> Self
temp.truncatingRemainder(dividingBy: 3.0) 10.0.double.truncatingRemainder(dividingBy: 3.0)
위 방식처럼 사용한다.
Developer Documentation