BDouble

public struct BDouble:
	ExpressibleByIntegerLiteral,
	ExpressibleByFloatLiteral,
	CustomStringConvertible,
	SignedNumeric,
	Comparable,
	Hashable,
	Sendable

Undocumented

Internal data

  • Absolute value type for BDouble operations.

    Declaration

    Swift

    public typealias Magnitude = Double
  • The absolute magnitude of the rational number as a Double.

    Declaration

    Swift

    public var magnitude: Double

Initializers

Descriptions

  • String representation of the rational number in fraction format.

    Declaration

    Swift

    public var description: String { get }
  • returns the current value in a fraction format

    Declaration

    Swift

    public var fractionDescription: String { get }
  • the global percision for all newly created values

    Declaration

    Swift

    public static var precision: Int { get set }
  • the precision for the current value

    Declaration

    Swift

    public var precision: Int { get set }
  • returns the current value in decimal format with the current precision

    Declaration

    Swift

    public var decimalDescription: String { get }
  • returns the current value in decimal format

    Declaration

    Swift

    public func decimalExpansion(precisionAfterComma digits: Int) -> String
  • Hash value for BDouble based on sign, numerator, and denominator.

    Declaration

    Swift

    public func hash(into hasher: inout Hasher)
  • Returns the size of the BDouble in bits.

    Declaration

    Swift

    public var size: Int { get }
  • Returns a formatted human readable string that says how much space (in bytes, kilobytes, megabytes, or gigabytes) the BDouble occupies

    Declaration

    Swift

    public var sizeDescription: String { get }
  • Undocumented

    Declaration

    Swift

    public func rawData() -> (sign: Bool, numerator: [UInt64], denominator: [UInt64])
  • Returns true if value is positive.

    Declaration

    Swift

    public func isPositive() -> Bool
  • Returns true if value is negative.

    Declaration

    Swift

    public func isNegative() -> Bool
  • Returns true if value is zero.

    Declaration

    Swift

    public func isZero() -> Bool
  • Reduces the fraction to its simplest form.

    Declaration

    Swift

    public mutating func minimize()
  • Rounds to the nearest integer value.

    Declaration

    Swift

    public func rounded() -> BInt

BDouble Addition

  • Declaration

    Swift

    public static func + (lhs: BDouble, rhs: BDouble) -> BDouble
  • Undocumented

    Declaration

    Swift

    public static func + (lhs: BDouble, rhs: Double) -> BDouble
  • Undocumented

    Declaration

    Swift

    public static func + (lhs: Double, rhs: BDouble) -> BDouble
  • Declaration

    Swift

    public static func += (lhs: inout BDouble, rhs: BDouble)
  • Undocumented

    Declaration

    Swift

    public static func += (lhs: inout BDouble, rhs: Double)

BDouble Negation

BDouble Subtraction

  • Declaration

    Swift

    public static func - (lhs: BDouble, rhs: BDouble) -> BDouble
  • Undocumented

    Declaration

    Swift

    public static func - (lhs: BDouble, rhs: Double) -> BDouble
  • Undocumented

    Declaration

    Swift

    public static func - (lhs: Double, rhs: BDouble) -> BDouble
  • Declaration

    Swift

    public static func -= (lhs: inout BDouble, rhs: BDouble)
  • Undocumented

    Declaration

    Swift

    public static func -= (lhs: inout BDouble, rhs: Double)

BDouble Multiplication

  • Declaration

    Swift

    public static func * (lhs: BDouble, rhs: BDouble) -> BDouble
  • Undocumented

    Declaration

    Swift

    public static func * (lhs: BDouble, rhs: Double) -> BDouble
  • Undocumented

    Declaration

    Swift

    public static func * (lhs: Double, rhs: BDouble) -> BDouble
  • Declaration

    Swift

    public static func *= (lhs: inout BDouble, rhs: BDouble)
  • Undocumented

    Declaration

    Swift

    public static func *= (lhs: inout BDouble, rhs: Double)

BDouble Exponentiation

  • Undocumented

    Declaration

    Swift

    public static func ** (base: BDouble, exponent: Int) -> BDouble

BDouble Division

  • Undocumented

    Declaration

    Swift

    public static func / (lhs: BDouble, rhs: BDouble) -> BDouble
  • Undocumented

    Declaration

    Swift

    public static func / (lhs: BDouble, rhs: Double) -> BDouble
  • Undocumented

    Declaration

    Swift

    public static func / (lhs: Double, rhs: BDouble) -> BDouble

BDouble Comparing

  • Declaration

    Swift

    public static func == (lhs: BDouble, rhs: BDouble) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func == (lhs: BDouble, rhs: Double) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func == (lhs: Double, rhs: BDouble) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func != (lhs: BDouble, rhs: BDouble) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func != (lhs: BDouble, rhs: Double) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func != (lhs: Double, rhs: BDouble) -> Bool
  • Declaration

    Swift

    public static func < (lhs: BDouble, rhs: BDouble) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func < (lhs: BDouble, rhs: Double) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func < (lhs: Double, rhs: BDouble) -> Bool
  • Declaration

    Swift

    public static func > (lhs: BDouble, rhs: BDouble) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func > (lhs: BDouble, rhs: Double) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func > (lhs: Double, rhs: BDouble) -> Bool
  • Declaration

    Swift

    public static func <= (lhs: BDouble, rhs: BDouble) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func <= (lhs: BDouble, rhs: Double) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func <= (lhs: Double, rhs: BDouble) -> Bool
  • Declaration

    Swift

    public static func >= (lhs: BDouble, rhs: BDouble) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func >= (lhs: BDouble, rhs: Double) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func >= (lhs: Double, rhs: BDouble) -> Bool