pub fn mode(data: &[f64]) -> Result<f64, String>
Mode: most frequent value. Ties broken by smallest value. Uses bit-exact comparison via to_bits() on a sorted copy.