Releases: leif-ibsen/BigInt
1.12.0
About BigInt release 1.12.0:
-
There is a new CRT structure which implemnts The Chinese Remainder Theorem.
It contains constructors to create an instance from given moduli
and a 'compute' method to compute the CRT value for a given set of residues.The same instance can be used again for other input data.
-
The newly introduced 'bernoulli' method to compute Bernoulli numbers had poor performance.
Its implementation is now changed to something more performant.For example 'bernoulli(1000)' now runs more than 250 times faster than it did before.
1.11.0
About BigInt release 1.11.0:
-
The functionality and API is the same as in release 1.10.0
-
Apple has removed the function
swift package generate-xcodeproj
in Xcode 14.3. This means that it is no longer possible to generate a Swift Package
and then turn it into an Xcode project, in order to define testability.Since there is now no Xcode project where testability can be enabled, the line
@testable import BigInt
must be inserted in every test file, in order to still be able to run the testsuite.
This has been done in release 1.11.0The testsuite must be run in release mode, otherwise it takes forever.
This can be done from the command line withswift test -c release -Xswiftc -enable-testing
The above considerations are only relevant for the development of BigInt,
not for people who just use BigInt.
1.10.0
New in release 1.10.0:
-
General performance improvements. In particular the 'modInverse' function has become faster.
If the modulus is a power of 2, it typically runs 10 times faster than it did before. -
The BFraction structure has a new static method 'bernoulli', which computes Bernoulli numbers. For example
print(BFraction.bernoulli(60))
print(BFraction.bernoulli(60).asDouble())would print
-1215233140483755572040304994079820246041491 / 56786730
-2.1399949257225335e+34The largest Bernoulli number that can be represented as a Double is bernoulli(258)
Release 1.9.0
New in release 1.9.0:
The addition, subtraction, multiplication and shift operations have been modified
to use the 'withUnsafeMutableBufferPointer' function in order to avoid
that the compiler generates - in this case unneccesary - array index bound checks.
This speeds up the execution. For example, the BigInt testsuite runs about 8 - 10% faster than it did before.
Thanks to Jack Leow for suggesting the use of 'withUnsafeMutableBufferPointer'.
1.8.0
Performance improvements in release 1.8.0:
-
The 'gcdExtended' function is now implemented using using Lehmer's method.
For 1000-bit numbers, it means that it now runs 5-6 times faster than before. -
The 'modInverse' function now computes its result using the 'gcdExtended' function.
For 1000-bit numbers, it means that it now runs 3-4 times faster than before.
Release 1.7.0
New in release 1.7.0:
-
In addition to the method
public func expMod(_ x: BInt, _ m: BInt) -> BInt
there is a new method
public func expMod(_ x: BInt, _ m: Int) -> Int
where the modulus is an 'Int' instead of a 'BInt'
a.expMod(x, 17) is much faster than a.expMod(x, BInt(17))
-
In addition to the method
public func sqrtMod(_ p: BInt) -> BInt?
there is a new method
public func sqrtMod(_ p: Int) -> Int?
where the prime number is an 'Int' instead of a 'BInt'
a.sqrtMod(17) is much faster than a.sqrtMod(BInt(17))
Release 1.6.0
New in release 1.6.0:
-
A new constructor to create a BInt from a decimal value i.e BInt(1.7e12)
-
A 'quotientExact' method where a.quotientExact(b) is faster than a / b if it is known that the remainder of the division is 0
-
A 'population' computed property that gives the number of 1 bits in a BInt, i.e. BInt(14).population is 3
1.5.1
New in release 1.5.1:
Minor bug fix in the '<<', '<<=', '>>' and '>>=' operations
Minor performance improvements in the comparions operations
Release 1.5.0
New in release 1.5.0:
BigInt release 1.5.0 supports fractions through a new structure 'BFraction' with numerators and denominators of unbounded size.
Standard arithmetic, comparison and rounding functions are supported.
A bug in the 'gcdExtended' function is fixed, so that it works correctly for negative inputs.
1.4.3
Changes in release 1.4.3:
Two new 'quotientAndRemainder' functions for computing the quotient and remainder
when dividing a BInt value by an Int value.
Better performance when mixing BInt values and Int values in arithmetic operations.