Releases: leif-ibsen/BigInt
Release 1.21.0
About BigInt release 1.21.0:
-
It is a bugfix release: Modular exponentiation a.expMod(x, m) gave a wrong result if m happened to be one of (BInt.ONE << (64 * n)), n = 1, 2, 3, ...
-
There is a new 'isPow2' property
-
The remaining API and functionality is unchanged
Release 1.20.0
About BigInt release 1.20.0:
-
The functionality and API is unchanged from release 1.19.0
-
Several minor documentation issues are fixed
Release 1.19.0
About BigInt release 1.19.0:
-
Release 1.19.0 is backwards compatible with release 1.18.0
-
Two new random functions: randomFrom(:), randomTo(:)
-
The extended GCD algorithm uses a new recursive GCD algorithm for large numbers with more than 64.000 bits.
The recursive algorithm is about 25 times faster than the Lehmer algorithm for numbers with 8.000.000 bits.
Release 1.18.0
About BigInt release 1.18.0:
-
A new recursive GCD algorithm for large numbers with more than 128.000 bits.
The new algorithm is about 15 times faster for numbers with 8.000.000 bits. -
Several minor performance improvements.
Release 1.17.0
About BigInt release 1.17.0:
-
The functionality and API is unchanged from release 1.16.0
-
The documentation has been restructured
Release 1.16.0
About BigInt release 1.16.0:
The functionality and API is unchanged from release 1.15.0
Some minor documentation inaccuracies are fixed
1.15.0
About BigInt release 1.15.0:
-
The functionality and API is unchanged from release 1.14.0
-
The documentation is build with Apple's DocC tool. It is available at the link
https://leif-ibsen.github.io/BigInt/documentation/bigint
and in the BigInt.doccarchive file
1.14.0
New in release 1.14.0:
-
Continued fractions are supported: A BFraction instance can be created from a continued fraction
represented as a sequence of integers.
A continued fraction (a sequence of integers) can be created from a BFraction instance. -
A new BFraction static function computes harmonic numbers, like 1 + 1/2 + ... + 1/n.
-
General improved performance in BFraction arithmetic.
Release 1.13.1
Release 1.13.1 is a bugfix release.
Bill James (wjamesjr) reported a bug in the Burnikel-Ziegler division function.
It gave wrong results for certain inputs.
He also provided test data that helped fix the bug, thanks.
The bug is fixed in release 1.13.1
1.13.0
New in release 1.13.0:
-
A new BFraction constructor from a string representation
public init?(_ x: String)
for example
BFraction("3.1415") // = 6283 / 200
BFraction("123E-3") // = 123 / 1000
BFraction("abc") // = nil
-
A new BFraction 'mod' method to compute the value modulo an integer
public func mod(_ m: BInt) -> BInt?
public func mod(_ m: Int) -> Int?for example
BFraction(13, 3).mod(5) // = Optional(1) because 3^(-1) mod 5 = 2 and (13 * 2).mod(5) = 1
Returns nil if the denominator and modulus are not coprime
-
The BFraction method 'asDecimalString' has a new API
public func asDecimalString(precision: Int, exponential: Bool = false) -> String
where precision is the number of significant digits
and exponential determines whether to use exponential or plain notation. For exampleBFraction(712, 11001).asDecimalString(precision: 5, exponential: false) // = "0.064721"
BFraction(712, 11001).asDecimalString(precision: 5, exponential: true ) // = "6.4721E-2" -
A new static BFraction method 'bernoulliSequence'
public static func bernoulliSequence(_ n: Int) -> [BFraction]
BFraction.bernoulliSequence(n) computes the n even indexed Bernoulli numbers B(0), B(2) ... B(2 * n - 2)
This is much faster than computing the same numbers individually.