BigDouble
public struct BigDouble:
ExpressibleByIntegerLiteral,
ExpressibleByFloatLiteral,
CustomStringConvertible,
SignedNumeric,
Comparable,
Hashable,
Strideable,
Codable
Undocumented
-
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: BigInt)
-
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
-
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, withPrecision eps: Double = 1.0E-15)
-
Declaration
Swift
public init(integerLiteral value: Int)
-
Declaration
Swift
public init(floatLiteral value: Double)
-
Undocumented
Declaration
Swift
public init(constant: Constant)
-
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 }
-
Undocumented
Declaration
Swift
public var locale: Locale
-
returns the current value in scientific notation
Declaration
Swift
public var scientificDescription: 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 }
-
Determines wether to use radians or degrees when using trigonometric functions
This method acts as a proxy for the global
radians
settingDeclaration
Swift
public var radians: Bool { get set }
-
The global setting for wether to use radians or degrees when using trigonometric functions
Declaration
Swift
public static var radians: Bool
-
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
-
Hashable
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Stride
Declaration
Swift
public typealias Stride = BigDouble
-
Similar to
+
operatorDeclaration
Swift
public func advanced(by n: BigDouble) -> BigDouble
-
Returns the value that is offset the specified distance from
self
.Declaration
Swift
public func distance(to other: BigDouble) -> BigDouble
-
Returns the size of the BigDouble 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 BigDouble 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 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 BigNumber
Declaration
Swift
public func rounded() -> BigInt
-
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) -> BigDouble?
-
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() -> BigDouble?
-
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)
-
makes the current value negative
Declaration
Swift
public mutating func negate()
-
Undocumented
Declaration
Swift
public prefix static func - (n: BigDouble) -> BigDouble
-
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)
-
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)
-
Undocumented
Declaration
Swift
public static func ** (base: BigDouble, exponent: Int) -> BigDouble
-
Undocumented
Declaration
Swift
public static func ** (base: BigDouble, exponent: BigInt) -> BigDouble
-
- reference: http://rosettacode.org/wiki/Nth_root
Declaration
Swift
public static func ** (base: BigDouble, exponent: BigDouble) -> BigDouble
-
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
-
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
-
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