Skip to content

Releases: leif-ibsen/BigInt

Release 1.21.0

12 Nov 14:15
Compare
Choose a tag to compare

About BigInt release 1.21.0:

  1. 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, ...

  2. There is a new 'isPow2' property

  3. The remaining API and functionality is unchanged

Release 1.20.0

31 Oct 12:27
Compare
Choose a tag to compare

About BigInt release 1.20.0:

  1. The functionality and API is unchanged from release 1.19.0

  2. Several minor documentation issues are fixed

Release 1.19.0

24 Jun 13:20
Compare
Choose a tag to compare

About BigInt release 1.19.0:

  1. Release 1.19.0 is backwards compatible with release 1.18.0

  2. Two new random functions: randomFrom(:), randomTo(:)

  3. 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

11 Jun 07:59
Compare
Choose a tag to compare

About BigInt release 1.18.0:

  1. 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.

  2. Several minor performance improvements.

Release 1.17.0

01 Mar 11:29
Compare
Choose a tag to compare

About BigInt release 1.17.0:

  1. The functionality and API is unchanged from release 1.16.0

  2. The documentation has been restructured

Release 1.16.0

15 Feb 08:49
Compare
Choose a tag to compare

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

25 Jan 08:44
Compare
Choose a tag to compare

About BigInt release 1.15.0:

  1. The functionality and API is unchanged from release 1.14.0

  2. 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

24 Sep 15:27
Compare
Choose a tag to compare

New in release 1.14.0:

  1. 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.

  2. A new BFraction static function computes harmonic numbers, like 1 + 1/2 + ... + 1/n.

  3. General improved performance in BFraction arithmetic.

Release 1.13.1

13 Jul 11:53
Compare
Choose a tag to compare

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

22 May 08:12
Compare
Choose a tag to compare

New in release 1.13.0:

  1. 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
  1. 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

  2. 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 example

    BFraction(712, 11001).asDecimalString(precision: 5, exponential: false) // = "0.064721"
    BFraction(712, 11001).asDecimalString(precision: 5, exponential: true ) // = "6.4721E-2"

  3. 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.