[258] Kern-Panic: partial_cmp().unwrap() auf NaN beim Sortieren
Ein Deckenpunkt bei 1e300 läuft in render3d (f32) zu inf/NaN über; die Sortierung der Schnittkreuzungen rief partial_cmp().unwrap() und panikte. Alle gleichartigen Sortierungen von Gleitkommazahlen (render3d section/mesh/openings, hatchgen, Kern wall_poche/area_report) nutzen total_cmp (NaN sortiert ans Ende). Regression: tests/robustness.rs regression_decke_nan_im_schnitt.
This commit is contained in:
6 files changed
+8
-8
No files matched your search
@@ -1359,7 +1359,7 @@ mod tests {
|
||||
((a.y - y) * (b.y - y) <= 0.0 && (b.y - a.y).abs() > 1e-12).then(|| a.x + (y - a.y) / (b.y - a.y) * (b.x - a.x))
|
||||
})
|
||||
.collect();
|
||||
xs.sort_by(|a, b| a.partial_cmp(b).unwrap());
|
||||
xs.sort_by(|a, b| a.total_cmp(b));
|
||||
xs
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user