[swift-users] Modulo operation in Swift?

Jens Persson jens at bitcycle.com
Thu Nov 9 05:43:20 CST 2017


Hi all!
Is there a modulo operation/function in Swift? I want the "true"
mathematical modulo (as % in Python), and not remainder (as % in Swift).

Do I have to implement this basic mathematical function myself and if so
what is the best way to write it (it will be heavily used so I want it to
be as fast as possible)?

/Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171109/ebd9e46e/attachment.html>


More information about the swift-users mailing list