|
11 | 11 | //! The complexity of encoding a point is O(order)
|
12 | 12 |
|
13 | 13 | use crate::geometry::OrientedBoundingBox;
|
| 14 | +use crate::nextafter::nextafter; |
14 | 15 | use crate::Point2D;
|
15 | 16 | use crate::Point3D;
|
16 | 17 | use crate::PointND;
|
@@ -201,7 +202,7 @@ fn segment_to_segment(min: f64, max: f64, order: usize) -> impl Fn(f64) -> u64 {
|
201 | 202 |
|
202 | 203 | // Map max to (2**order-1).
|
203 | 204 | while n <= width * f {
|
204 |
| - f = crate::nextafter(f, 0.0); |
| 205 | + f = nextafter(f, 0.0); |
205 | 206 | }
|
206 | 207 |
|
207 | 208 | move |v| {
|
@@ -582,13 +583,13 @@ mod tests {
|
582 | 583 | assert_eq!(mapping(7.0), 6);
|
583 | 584 | assert_eq!(mapping(8.0), 7);
|
584 | 585 |
|
585 |
| - assert_eq!(mapping(crate::nextafter(1.0, f64::INFINITY)), 1); |
586 |
| - assert_eq!(mapping(crate::nextafter(2.0, f64::INFINITY)), 2); |
587 |
| - assert_eq!(mapping(crate::nextafter(3.0, f64::INFINITY)), 3); |
588 |
| - assert_eq!(mapping(crate::nextafter(4.0, f64::INFINITY)), 4); |
589 |
| - assert_eq!(mapping(crate::nextafter(5.0, f64::INFINITY)), 5); |
590 |
| - assert_eq!(mapping(crate::nextafter(6.0, f64::INFINITY)), 6); |
591 |
| - assert_eq!(mapping(crate::nextafter(7.0, f64::INFINITY)), 7); |
| 586 | + assert_eq!(mapping(nextafter(1.0, f64::INFINITY)), 1); |
| 587 | + assert_eq!(mapping(nextafter(2.0, f64::INFINITY)), 2); |
| 588 | + assert_eq!(mapping(nextafter(3.0, f64::INFINITY)), 3); |
| 589 | + assert_eq!(mapping(nextafter(4.0, f64::INFINITY)), 4); |
| 590 | + assert_eq!(mapping(nextafter(5.0, f64::INFINITY)), 5); |
| 591 | + assert_eq!(mapping(nextafter(6.0, f64::INFINITY)), 6); |
| 592 | + assert_eq!(mapping(nextafter(7.0, f64::INFINITY)), 7); |
592 | 593 | }
|
593 | 594 |
|
594 | 595 | #[test]
|
|
0 commit comments