Commit 5d74a582 authored by Olivier Tilloy's avatar Olivier Tilloy

Fix rounding error on i386 (#455).

parent 60b26b5a
......@@ -44,7 +44,9 @@ impl Angle {
// Normalizes an angle to [0.0, 2*PI)
fn normalize(rad: f64) -> f64 {
let res = rad % (PI * 2.0);
if res < 0.0 {
if res.abs() < std::f64::EPSILON {
res.abs()
} else if res < 0.0 {
res + PI * 2.0
} else {
res
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment