Skip to content

Commit

Permalink
style: Double f64::EPSILON for calculation error.
Browse files Browse the repository at this point in the history
It's possible that both this_weight and other_weght have calculation errors
which are approximately equal to f64::EPSILON.

Bug: 1468294
Reviewed-by: birtles
MozReview-Commit-ID: 8OddG9rI3qd
  • Loading branch information
Hiroyuki Ikezoe authored and emilio committed Jun 18, 2018
1 parent 9d679c9 commit 238314e
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -1739,7 +1739,9 @@ impl Animate for Quaternion {

let (this_weight, other_weight) = procedure.weights();
debug_assert!(
(this_weight + other_weight - 1.0f64).abs() <= f64::EPSILON ||
// Doule EPSILON since both this_weight and other_weght have calculation errors
// which are approximately equal to EPSILON.
(this_weight + other_weight - 1.0f64).abs() <= f64::EPSILON * 2.0 ||
other_weight == 1.0f64 || other_weight == 0.0f64,
"animate should only be used for interpolating or accumulating transforms"
);
Expand Down

0 comments on commit 238314e

Please sign in to comment.