[swift-evolution] TrigonometricFloatingPoint/MathFloatingPoint protocol?

Taylor Swift kelvin13ma at gmail.com
Mon Jul 31 12:03:37 CDT 2017


How would people feel about adding a protocol

protocol MathFloatingPoint:FloatingPoint
{
    func sin() -> Self
    func cos() -> Self
    func tan() -> Self
    func asin() -> Self
    func acos() -> Self
    func atan() -> Self

    func ln() -> Self
    func log(base:Self) -> Self
    func pow(exponent:Self) -> Self
    func exp() -> Self
}

to the standard library? Float and Double would then be made to conform by
default using Swift implementations instead of having to import Glibc /
Darwin and writing the extensions, depending on platform.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170731/1bd2eb66/attachment.html>


More information about the swift-evolution mailing list