BDouble

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

Undocumented

  • returns the current value in a 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 (always with a decimal point).

    Declaration

    Swift

    public func decimalExpansion(precisionAfterDecimalPoint precision: Int, rounded: Bool = true) -> String

    Parameters

    precision

    the precision after the decimal point

    rounded

    whether or not the return value’s last digit will be rounded up

  • 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 formated 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])
  • Declaration

    Swift

    public func isPositive() -> Bool

    Return Value

    True if positive, False otherwise

  • Declaration

    Swift

    public func isNegative() -> Bool

    Return Value

    True if negative, False otherwise

  • Declaration

    Swift

    public func isZero() -> Bool

    Return Value

    True if 0, False otherwise

  • Undocumented

    Declaration

    Swift

    public mutating mutating func minimize()
  • If the right side of the decimal is greater than 0.5 then it will round up (ceil), otherwise round down (floor) to the nearest BInt

    Declaration

    Swift

    public func rounded() -> BInt
  • The power of 1/root

    Warning

    This may take a while. This is only precise up until precision. When comparing results after this function use nearlyEqual`

    Declaration

    Swift

    public func nthroot(_ root: Int) -> BDouble
  • The square root

    Warning

    This may take a while. This is only precise up until precision. When comparing results after this function use nearlyEqual`

    Declaration

    Swift

    public func squareRoot() -> BDouble
  • makes the current value negative

    Declaration

    Swift

    public mutating mutating func negate()
  • Declaration

    Swift

    public prefix static func - (n: BDouble) -> BDouble
  • 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: BDouble, rhs: BInt) -> BDouble
  • Undocumented

    Declaration

    Swift

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