diff --git a/Sources/Complex/Arithmetic.swift b/Sources/Complex/Arithmetic.swift index 226ae69..9d75f23 100644 --- a/Sources/Complex/Arithmetic.swift +++ b/Sources/Complex/Arithmetic.swift @@ -143,7 +143,7 @@ extension Complex: Numeric { /// The reciprocal of this value, if it can be computed without undue overflow or underflow. /// - /// If z.reciprocal is non-nil, you can safely replace division by z with multiplcation by this value. It is + /// If z.reciprocal is non-nil, you can safely replace division by z with multiplication by this value. It is /// not advantageous to do this for an isolated division, but if you are dividing many values by a single /// denominator, this will often be a significant performance win. /// diff --git a/Sources/Complex/Complex.swift b/Sources/Complex/Complex.swift index 513de47..5f45167 100644 --- a/Sources/Complex/Complex.swift +++ b/Sources/Complex/Complex.swift @@ -180,7 +180,7 @@ extension Complex { /// True if this value is subnormal. /// /// A complex number is subnormal if it is finite, not normal, and not zero. When the result of a - /// computation is subnormal, underflow has occured and the result generally does not have full + /// computation is subnormal, underflow has occurred and the result generally does not have full /// precision. /// See also: /// - @@ -239,7 +239,7 @@ extension Complex { /// /// This is mainly useful for interoperation with other languages, where /// you may want to reduce each equivalence class to a single representative - /// before passing across langauge boundaries, but it may also be useful + /// before passing across language boundaries, but it may also be useful /// for some serialization tasks. It's also a useful implementation detail for /// some primitive operations. @_transparent @@ -349,7 +349,7 @@ extension Complex: Hashable { // FloatingPoint does not refine Codable, so this is a conditional conformance. extension Complex: Codable where RealType: Codable { } -// MARK: - Formating +// MARK: - Formatting extension Complex: CustomStringConvertible { public var description: String { guard isFinite else { diff --git a/Sources/Real/Real.swift b/Sources/Real/Real.swift index e1c246c..44016d7 100644 --- a/Sources/Real/Real.swift +++ b/Sources/Real/Real.swift @@ -33,7 +33,7 @@ public protocol Real: FloatingPoint, RealFunctions { // it does allow us to default the implementation of a few operations, // and also provides `signGamma`. extension Real { - // Most math libraries do not provide exp10, so we need a default impl. + // Most math libraries do not provide exp10, so we need a default implementation. @_transparent public static func exp10(_ x: Self) -> Self { return pow(10, x) diff --git a/Sources/Real/RealFunctions.swift b/Sources/Real/RealFunctions.swift index 10d4b5c..a9d6305 100644 --- a/Sources/Real/RealFunctions.swift +++ b/Sources/Real/RealFunctions.swift @@ -98,7 +98,7 @@ public protocol RealFunctions: ElementaryFunctions { /// The sign of the gamma function, Γ(x). /// /// For `x >= 0`, `signGamma(x)` is `.plus`. For negative `x`, `signGamma(x)` is `.plus` - /// when `x` is an integer, and otherwise it is `.minus` whenver `trunc(x)` is even, and `.plus` + /// when `x` is an integer, and otherwise it is `.minus` whenever `trunc(x)` is even, and `.plus` /// when `trunc(x)` is odd. /// /// This function is used together with `logGamma`, which computes the logarithm of the diff --git a/Sources/Real/ScalarConformances.swift b/Sources/Real/ScalarConformances.swift index ffc1e14..9bb7be3 100644 --- a/Sources/Real/ScalarConformances.swift +++ b/Sources/Real/ScalarConformances.swift @@ -15,6 +15,7 @@ // and the Swift platform module are both imported (). import NumericsShims +// MARK: Float + Real extension Float: Real { @_transparent public static func cos(_ x: Float) -> Float { return libm_cosf(x) } @_transparent public static func sin(_ x: Float) -> Float { return libm_sinf(x) } @@ -68,6 +69,7 @@ extension Float: Real { #endif } +// MARK: Double + Real extension Double: Real { @_transparent public static func cos(_ x: Double) -> Double { return libm_cos(x) } @_transparent public static func sin(_ x: Double) -> Double { return libm_sin(x) } @@ -136,6 +138,7 @@ extension Double: Real { #endif } +// MARK: Float80 + Real #if (arch(i386) || arch(x86_64)) && !os(Windows) && !os(Android) extension Float80: Real { @_transparent public static func cos(_ x: Float80) -> Float80 { return libm_cosl(x) }