BDouble
public struct BDouble:
ExpressibleByIntegerLiteral,
ExpressibleByFloatLiteral,
CustomStringConvertible,
SignedNumeric,
Comparable,
Hashable,
Codable
Undocumented
-
Undocumented
Declaration
Swift
public internal(set) var sign: Bool { get }
-
Undocumented
Declaration
Swift
public internal(set) var numerator: Limbs { get }
-
Undocumented
Declaration
Swift
public internal(set) var denominator: Limbs { get }
-
Declaration
Swift
public typealias Magnitude = Double
-
Declaration
Swift
public var magnitude: Double
-
Declaration
Swift
public init?<T>(exactly source: T) where T : BinaryInteger
-
Undocumented
Declaration
Swift
public init(_ src: BInt)
-
Inits a BDouble 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 BDouble
-
Undocumented
-
Undocumented
Declaration
Swift
public init(_ numerator: Int, over denominator: Int)
-
Undocumented
Declaration
Swift
public init?(_ numerator: String, over denominator: String)
-
Undocumented
Declaration
Swift
public init?(_ nStr: String)
-
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)
-
Undocumented
Declaration
Swift
public init(_ z: Int)
-
Undocumented
Declaration
Swift
public init(_ d: Double)
-
Declaration
Swift
public init(integerLiteral value: Int)
-
Declaration
Swift
public init(floatLiteral value: Double)
-
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 functionuse
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 functionuse
nearlyEqual`Declaration
Swift
public func squareRoot() -> BDouble
-
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
-
Undocumented
Declaration
Swift
public static func + (lhs: BDouble, rhs: BInt) -> BDouble
-
Undocumented
Declaration
Swift
public static func + (lhs: BInt, rhs: BDouble) -> BDouble
-
Declaration
Swift
public static func += (lhs: inout BDouble, rhs: BDouble)
-
Undocumented
Declaration
Swift
public static func += (lhs: inout BDouble, rhs: Double)
-
makes the current value negative
Declaration
Swift
public mutating mutating func negate()
-
Declaration
Swift
public prefix static func - (n: BDouble) -> BDouble
-
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
-
Undocumented
Declaration
Swift
public static func - (lhs: BDouble, rhs: BInt) -> BDouble
-
Declaration
Swift
public static func -= (lhs: inout BDouble, rhs: BDouble)
-
Undocumented
Declaration
Swift
public static func -= (lhs: inout BDouble, rhs: Double)
-
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
-
Undocumented
Declaration
Swift
public static func * (lhs: BDouble, rhs: BInt) -> BDouble
-
Undocumented
Declaration
Swift
public static func * (lhs: BInt, rhs: BDouble) -> BDouble
-
Declaration
Swift
public static func *= (lhs: inout BDouble, rhs: BDouble)
-
Undocumented
Declaration
Swift
public static func *= (lhs: inout BDouble, rhs: Double)
-
Undocumented
Declaration
Swift
public static func ** (base: BDouble, exponent: Int) -> BDouble
-
Undocumented
Declaration
Swift
public static func ** (base: BDouble, exponent: BInt) -> BDouble
-
- reference: http://rosettacode.org/wiki/Nth_root
Declaration
Swift
public static func ** (base: BDouble, exponent: 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
-
An == comparison with an epsilon (fixed then a calculated
ULPs
) Reference: http://floating-point-gui.de/errors/comparison/ Reference: https://bitbashing.io/comparing-floats.htmlDeclaration
Swift
public static func nearlyEqual(_ lhs: BDouble, _ rhs: BDouble, epsilon: Double = 0.00001) -> 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
-
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