John Schmidt e487b576fa Changes to lowerBound/upperBound/equalRange
The old definitions had some problems:

- In `lowerBound`, the `lhs` (left hand side) argument was passed on the
  right hand side.
- In `upperBound`, the `greaterThan` function needed to return
  `greaterThanOrEqual` for the function work, so either the name or the
  implementation is incorrect.

To fix both problems, define the functions in terms of a `lessThan` function that returns `lhs < rhs`.
The is more consistent with the rest of `sort.zig` and it's also how C++ implements lower/upperBound (1)(2).

(1) https://en.cppreference.com/w/cpp/algorithm/lower_bound
(2) https://en.cppreference.com/w/cpp/algorithm/upper_bound

- Rewrite doc comments.
- Add a couple of more test cases.
- Add docstring for std.sort.binarySearch
2024-02-07 21:00:24 +01:00
..
2023-11-25 12:28:19 +02:00
2024-01-29 14:30:23 -08:00
2023-11-22 19:08:55 -07:00
2023-12-19 12:01:09 -07:00
2024-01-13 19:37:33 -07:00
2023-11-22 13:24:27 -05:00
2023-11-22 19:08:55 -07:00
2024-02-05 11:55:14 +03:30
2024-01-13 23:56:32 -07:00
2024-01-29 14:30:23 -08:00
2023-10-23 22:42:18 -04:00
2023-11-09 17:41:14 +01:00
2023-11-22 15:24:57 -07:00
2024-02-05 11:55:14 +03:30
2023-10-25 04:28:30 -04:00
2024-01-24 12:48:12 +01:00
2024-01-14 20:45:39 -05:00
2024-02-04 19:08:57 +01:00
2023-11-03 23:18:21 -04:00
2023-11-19 09:55:07 +00:00
2024-02-07 12:41:40 +02:00
2023-11-22 13:24:27 -05:00
2024-02-05 11:55:14 +03:30
2024-02-05 11:55:14 +03:30
2023-12-20 20:05:16 -08:00
2023-10-21 21:24:55 +00:00