NumericAnnex Reference (100% documented)

View on GitHub

Install in Dash

UnsignedInteger

protocol UnsignedInteger : BinaryInteger where Self.Magnitude : BinaryInteger
Topics

Cube Root

  • cbrt(_:)

    Returns the cube root of x, rounding toward zero.

    Declaration

    Swift

    public static func cbrt(_ x: Self) -> Self

Factoring

  • gcd(_:_:)

    Returns the greatest common divisor of a and b.

    Declaration

    Swift

    public static func gcd(_ a: Self, _ b: Self) -> Self
  • lcm(_:_:)

    Returns the least common multiple of a and b.

    Declaration

    Swift

    public static func lcm(_ a: Self, _ b: Self) -> Self

Factoring (Fixed-Width)

  • lcmReportingOverflow(_:_:)

    Returns the least common multiple of a and b and a flag to indicate whether overflow occurred during the operation.

    Declaration

    Swift

    public static func lcmReportingOverflow(_ a: Self, _ b: Self)
        -> (partialValue: Self, overflow: Bool)
  • lcmFullWidth(_:_:)

    Returns the high and low parts of the least common multiple of a and b computed using full-width arithmetic.

    Declaration

    Swift

    public static func lcmFullWidth(_ a: Self, _ b: Self)
        -> (high: Self, low: Self.Magnitude)