()
| 290 | |
| 291 | #[test] |
| 292 | fn test_next_down() { |
| 293 | let x = 1.0f64; |
| 294 | // Clamp value into range [0, 1). |
| 295 | let clamped = x.clamp(0.0, next_down(1.0f64)); |
| 296 | assert!(clamped < 1.0); |
| 297 | assert_eq!(next_up(clamped), 1.0); |
| 298 | } |
| 299 | |
| 300 | #[test] |
| 301 | fn test_next_up_small_positive() { |