Rational

public struct Rational
extension Rational: CustomStringConvertible
extension Rational: Hashable

Swift representation of a rational number

Public properties

  • Numerator part. Carries the sign of the rational number

    Declaration

    Swift

    public let numerator: Int
  • Denominator part

    Declaration

    Swift

    public let denominator: Int

Public init methods

Public constants

  • Constant: 0/1

    Declaration

    Swift

    public static let zero: Rational

CustomStringConvertible methods

  • Declaration

    Swift

    public var description: String { get }