BigDouble

public struct BigDouble:
ExpressibleByIntegerLiteral,
ExpressibleByFloatLiteral,
CustomStringConvertible,
SignedNumeric,
Comparable,
Hashable,
Strideable

Undocumented

Internal data

•  Magnitude 

Declaration

Swift

public typealias Magnitude = Double
•  magnitude 

Declaration

Swift

public var magnitude: Double

Initializers

•  init(exactly:) 

Declaration

Swift

public init?<T>(exactly source: T) where T : BinaryInteger
•  init(_:) 

Undocumented

Declaration

Swift

public init(_ src: BigInt)
•  init(sign:numerator:denominator:) 

Inits a BigDouble with two Limbs as numerator and denominator

• numerator: The upper part of the fraction as Limbs
• denominator: The lower part of the fraction as Limbs

Returns: A new BigDouble

Declaration

Swift

public init(sign: Bool, numerator: Limbs, denominator: Limbs)
•  init(_:over:) 

Undocumented

Declaration

Swift

public init(_ numerator: BigInt, over denominator: BigInt)
•  init(_:over:) 

Undocumented

Declaration

Swift

public init(_ numerator: Int, over denominator: Int)
•  init(_:over:) 

Undocumented

Declaration

Swift

public init?(_ numerator: String, over denominator: String)
•  init(_:) 

Undocumented

Declaration

Swift

public init?(_ nStr: String)
•  init(_:radix:) 

Create an instance initialized to a string with the value of mathematical numerical system of the specified radix (base). So for example, to get the value of hexadecimal string radix value must be set to 16.

Declaration

Swift

public init?(_ nStr: String, radix: Int)
•  init(_:) 

Undocumented

Declaration

Swift

public init(_ z: Int)
•  init(_:withPrecision:) 

Undocumented

Declaration

Swift

public init(_ d: Double, withPrecision eps: Double = 1.0E-15)
•  init(integerLiteral:) 

Declaration

Swift

public init(integerLiteral value: Int)
•  init(floatLiteral:) 

Declaration

Swift

public init(floatLiteral value: Double)
•  init(constant:) 

Undocumented

Declaration

Swift

public init(constant: Constant)

Descriptions

•  description 

returns the current value in a fraction format

Declaration

Swift

public var description: String { get }
•  fractionDescription 

returns the current value in a fraction format

Declaration

Swift

public var fractionDescription: String { get }
•  locale 

Undocumented

Declaration

Swift

public var locale: Locale
•  scientificDescription 

returns the current value in scientific notation

Declaration

Swift

public var scientificDescription: String { get }
•  precision 

the global percision for all newly created values

Declaration

Swift

public static var precision: Int { get set }
•  precision 

the precision for the current value

Declaration

Swift

public var precision: Int { get set }
•  radians 

Determines wether to use radians or degrees when using trigonometric functions

This method acts as a proxy for the global radians setting

Declaration

Swift

public var radians: Bool { get set }
•  radians 

The global setting for wether to use radians or degrees when using trigonometric functions

Declaration

Swift

public static var radians: Bool
•  decimalDescription 

returns the current value in decimal format with the current precision

Declaration

Swift

public var decimalDescription: String { get }
•  decimalExpansion(precisionAfterDecimalPoint:rounded:) 

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
•  hash(into:) 

Hashable

Declaration

Swift

public func hash(into hasher: inout Hasher)
•  Stride 

Stride

Declaration

Swift

public typealias Stride = BigDouble
•  advanced(by:) 

Similar to + operator

Declaration

Swift

public func advanced(by n: BigDouble) -> BigDouble
•  distance(to:) 

Returns the value that is offset the specified distance from self.

Declaration

Swift

public func distance(to other: BigDouble) -> BigDouble
•  size 

Returns the size of the BigDouble in bits.

Declaration

Swift

public var size: Int { get }
•  sizeDescription 

Returns a formated human readable string that says how much space (in bytes, kilobytes, megabytes, or gigabytes) the BigDouble occupies

Declaration

Swift

public var sizeDescription: String { get }
•  rawData() 

Undocumented

Declaration

Swift

public func rawData() -> (sign: Bool, numerator: [UInt64], denominator: [UInt64])
•  isPositive() 

Declaration

Swift

public func isPositive() -> Bool

Return Value

True if positive, False otherwise

•  isNegative() 

Declaration

Swift

public func isNegative() -> Bool

Return Value

True if negative, False otherwise

•  isZero() 

Declaration

Swift

public func isZero() -> Bool

Return Value

True if 0, False otherwise

•  minimize() 

Undocumented

Declaration

Swift

public mutating func minimize()
•  rounded() 

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 BigNumber

Declaration

Swift

public func rounded() -> BigInt
•  nthroot(_:) 

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) -> BigDouble?
•  squareRoot() 

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() -> BigDouble?
•  asDouble(precision:) 

Returns BigNumber’s value as an integer. Conversion only works when self has only one limb that’s within the range of the type “Int”.

Declaration

Swift

public func asDouble(precision: Int = 10) -> Double?

•  +(_:_:) 

Undocumented

Declaration

Swift

public static func + (lhs: BigDouble, rhs: BigDouble) -> BigDouble
•  +(_:_:) 

Undocumented

Declaration

Swift

public static func + (lhs: BigDouble, rhs: Double) -> BigDouble
•  +(_:_:) 

Undocumented

Declaration

Swift

public static func + (lhs: Double, rhs: BigDouble) -> BigDouble
•  +(_:_:) 

Undocumented

Declaration

Swift

public static func + (lhs: BigDouble, rhs: BigInt) -> BigDouble
•  +(_:_:) 

Undocumented

Declaration

Swift

public static func + (lhs: BigInt, rhs: BigDouble) -> BigDouble
•  +=(_:_:) 

Undocumented

Declaration

Swift

public static func += (lhs: inout BigDouble, rhs: BigDouble)
•  +=(_:_:) 

Undocumented

Declaration

Swift

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

BigDouble Negation

•  negate() 

makes the current value negative

Declaration

Swift

public mutating func negate()
•  -(_:) 

Undocumented

Declaration

Swift

public prefix static func - (n: BigDouble) -> BigDouble

BigDouble Subtraction

•  -(_:_:) 

Undocumented

Declaration

Swift

public static func - (lhs: BigDouble, rhs: BigDouble) -> BigDouble
•  -(_:_:) 

Undocumented

Declaration

Swift

public static func - (lhs: BigDouble, rhs: Double) -> BigDouble
•  -(_:_:) 

Undocumented

Declaration

Swift

public static func - (lhs: Double, rhs: BigDouble) -> BigDouble
•  -(_:_:) 

Undocumented

Declaration

Swift

public static func - (lhs: BigDouble, rhs: BigInt) -> BigDouble
•  -=(_:_:) 

Undocumented

Declaration

Swift

public static func -= (lhs: inout BigDouble, rhs: BigDouble)
•  -=(_:_:) 

Undocumented

Declaration

Swift

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

BigDouble Multiplication

•  *(_:_:) 

Undocumented

Declaration

Swift

public static func * (lhs: BigDouble, rhs: BigDouble) -> BigDouble
•  *(_:_:) 

Undocumented

Declaration

Swift

public static func * (lhs: BigDouble, rhs: Double) -> BigDouble
•  *(_:_:) 

Undocumented

Declaration

Swift

public static func * (lhs: Double, rhs: BigDouble) -> BigDouble
•  *(_:_:) 

Undocumented

Declaration

Swift

public static func * (lhs: BigDouble, rhs: BigInt) -> BigDouble
•  *(_:_:) 

Undocumented

Declaration

Swift

public static func * (lhs: BigInt, rhs: BigDouble) -> BigDouble
•  *=(_:_:) 

Undocumented

Declaration

Swift

public static func *= (lhs: inout BigDouble, rhs: BigDouble)
•  *=(_:_:) 

Undocumented

Declaration

Swift

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

BigDouble Exponentiation

•  **(_:_:) 

Undocumented

Declaration

Swift

public static func ** (base: BigDouble, exponent: Int) -> BigDouble
•  **(_:_:) 

Undocumented

Declaration

Swift

public static func ** (base: BigDouble, exponent: BigInt) -> BigDouble
•  **(_:_:) 

Declaration

Swift

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

BigDouble Division

•  /(_:_:) 

Quick division (using defined precision by default for better performances)

Declaration

Swift

public static func / (lhs: BigDouble, rhs: BigDouble) -> BigDouble
•  /(_:_:) 

Undocumented

Declaration

Swift

public static func / (lhs: BigDouble, rhs: Double) -> BigDouble
•  /(_:_:) 

Undocumented

Declaration

Swift

public static func / (lhs: BigDouble, rhs: BigInt) -> BigDouble
•  /(_:_:) 

Undocumented

Declaration

Swift

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

BigDouble Comparing

•  nearlyEqual(_:_:epsilon:) 

An == comparison with an epsilon (fixed then a calculated “ULPs”) Reference: http://floating-point-gui.de/errors/comparison/ Reference: https://bitbashing.io/comparing-floats.html

Declaration

Swift

public static func nearlyEqual(_ lhs: BigDouble, _ rhs: BigDouble, epsilon: Double = 0.00001) -> Bool
•  nearlyEquals(_:epsilon:) 

An == comparison with an epsilon (fixed then a calculated “ULPs”) Reference: http://floating-point-gui.de/errors/comparison/ Reference: https://bitbashing.io/comparing-floats.html

Declaration

Swift

public func nearlyEquals(_ rhs: BigDouble, epsilon: Double = 0.00001) -> Bool
•  ==(_:_:) 

Undocumented

Declaration

Swift

public static func == (lhs: BigDouble, rhs: BigDouble) -> Bool
•  ==(_:_:) 

Undocumented

Declaration

Swift

public static func == (lhs: BigDouble, rhs: Double) -> Bool
•  ==(_:_:) 

Undocumented

Declaration

Swift

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

Undocumented

Declaration

Swift

public static func != (lhs: BigDouble, rhs: BigDouble) -> Bool
•  !=(_:_:) 

Undocumented

Declaration

Swift

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

Undocumented

Declaration

Swift

public static func != (lhs: Double, rhs: BigDouble) -> Bool
•  <(_:_:) 

Undocumented

Declaration

Swift

public static func < (lhs: BigDouble, rhs: BigDouble) -> Bool
•  <(_:_:) 

Undocumented

Declaration

Swift

public static func < (lhs: BigDouble, rhs: Double) -> Bool
•  <(_:_:) 

Undocumented

Declaration

Swift

public static func < (lhs: Double, rhs: BigDouble) -> Bool
•  >(_:_:) 

Undocumented

Declaration

Swift

public static func > (lhs: BigDouble, rhs: BigDouble) -> Bool
•  >(_:_:) 

Undocumented

Declaration

Swift

public static func > (lhs: BigDouble, rhs: Double) -> Bool
•  >(_:_:) 

Undocumented

Declaration

Swift

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

Undocumented

Declaration

Swift

public static func <= (lhs: BigDouble, rhs: BigDouble) -> Bool
•  <=(_:_:) 

Undocumented

Declaration

Swift

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

Undocumented

Declaration

Swift

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

Undocumented

Declaration

Swift

public static func >= (lhs: BigDouble, rhs: BigDouble) -> Bool
•  >=(_:_:) 

Undocumented

Declaration

Swift

public static func >= (lhs: BigDouble, rhs: Double) -> Bool
•  >=(_:_:) 

Undocumented

Declaration

Swift

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