3 ms·
In Swift % is the remainder operator [0][1] and there's also the `.truncatingRemainder(dividingBy:)` and `.remainder(dividingBy:)` methods on floating-point typ
by Razengan 8y ago
In Swift % is the remainder operator [0][1] and there's also the `.truncatingRemainder(dividingBy:)` and `.remainder(dividingBy:)` methods on floating-point types [2].
[0] https://docs.swift.org/swift-book/LanguageGuide/BasicOperators.html https://docs.swift.org/swift-book/LanguageGuide/BasicOperato...
[1] https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160523/018679.html https://lists.swift.org/pipermail/swift-evolution/Week-of-Mo...
[2] https://developer.apple.com/documentation/swift/float/2886166-truncatingremainder https://developer.apple.com/documentation/swift/float/288616...