Merge pull request #36 from Sajjon/fix_typos_in_code

Fix typos in source code
This commit is contained in:
Stephen Canon authored and GitHub committed 2019-11-08 09:33:23 -05:00
commit 5d4368257e
5 files changed
+9 -6

No files matched your search

+1 -1
View File
@@ -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.
///
+3 -3
View File
@@ -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 {
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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
+3
View File
@@ -15,6 +15,7 @@
// and the Swift platform module are both imported (<rdar://problem/53821031>).
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) }