()
| 267 | |
| 268 | #[test] |
| 269 | fn pi_multiples() { |
| 270 | let values: Vec<f64> = (1..1000).map(|i| std::f64::consts::PI * i as f64).collect(); |
| 271 | let encoded = encode(&values).unwrap(); |
| 272 | let decoded = decode(&encoded).unwrap(); |
| 273 | for (i, (a, b)) in values.iter().zip(decoded.iter()).enumerate() { |
| 274 | assert_eq!(a.to_bits(), b.to_bits(), "mismatch at {i}"); |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | #[test] |
| 279 | fn scientific_data() { |