Skip to content

Commit 498d4d2

Browse files
committed
Last documentation update.
1 parent 07287d3 commit 498d4d2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@ Its functionality falls in the following categories:
1818
- Primes: prime number testing, probable prime number generation and primorial
1919
- Miscellaneous: random number generation, greatest common divisor, least common multiple, n-th root, square root modulo an odd prime, Jacobi symbol, Kronecker symbol, Factorial function, Binomial function, Fibonacci numbers, Lucas numbers and Bernoulli numbers
2020
- Fractions: Standard arithmetic on fractions whose numerators and denominators are of unbounded size
21+
22+
## Protocol support
23+
24+
- Added `SignedInteger`, `BinaryInteger`, and `Numeric` protocol compliance.
25+
- Optional support for `StaticBigInt` to allow `BigInt` number initialization
26+
from very large integer literals. Uncomment the `BigInt-Extensions`
27+
`StaticBigInt` support.
28+
29+
Why support protocols? By supporting them you have the ability to
30+
formulate generic algorithms and make use of algorithms from others
31+
that use the protocol type(s) you support. For example, `Strideable`
32+
compliance is free (with `BinaryInteger`) and lets you do things like
33+
34+
```swift
35+
for i in BInt(1)...10 {
36+
print(i.words)
37+
}
38+
```
39+
40+
In addition, if a third party defines extensions for the supported protocols,
41+
these can be easily adapted by just conforming to that protocol.
2142

2243
BigInt requires Swift 5.0. It also requires that the Int and UInt types be 64 bit types.
2344

0 commit comments

Comments
 (0)