Commit Graph
9 Commits
Author SHA1 Message Date
Stephen Canon a0b7954f80 Use Swift Numerics for elementary functions instead of Darwin/Glibc/etc (#28)
Also lets us use root instead of exp(log(x)/k), which is more accurate in some cases (but mainly is just nicer to read).

The downside is that this introduces a dependency for Algorithms, where previously it had none. I think that Numerics is an OK thing to depend on (especially for these functions, which are available from 0.0.1), but it _is_ a _massive increase_ in the number of dependencies that the package has, and we should give that some thought.
2020-10-19 16:40:31 -05:00
Tim Vermeulen fb69aacc5d Fix Product2's indexing logic (#26)
* Change representation of `Product2`'s `endIndex`

* Fix `Product2.index(before:)`

* Fix `Product2.distance(from:to:)`

* Make comment more specific
2020-10-15 10:41:33 -05:00
Tim Vermeulen 2beda36a49 Fix and improve Chain's index offsetting logic (#22)
* Add tests

* Fix offsetting logic

* Avoid unnecessary computations
2020-10-13 14:53:47 -05:00
Egor Zhdan 864d460a07 Fix build on Windows (#13)
log & exp are declared in `ucrt.corecrt.math`
2020-10-12 09:40:25 -05:00
Tim Vermeulen c67dd3419c Implement distance(from:to:) for Chain (#3)
* Add Chain.distance(from:to:)

* Add test
2020-10-12 09:36:13 -05:00
Nate Cook dd2ad89a1b Add missing documentation to rotate and reverse 2020-10-09 10:50:16 -05:00
Nate Cook 1df76cfaa4 Rename rotate(at:) to rotate(toStartAt:)
This was the intended name for the rotate method, just missed in
the initial release.
2020-10-09 10:50:16 -05:00
Ian Keen cffb44dceb Update Indexed.swift (#8) 2020-10-08 12:48:44 -05:00
Nate Cook 6cffd04a4f Initial import 2020-10-07 10:24:43 -05:00