style: Double f64::EPSILON for calculation error.

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
This commit is contained in:
Hiroyuki Ikezoe 2018-06-13 06:42:14 +09:00 committed by Emilio Cobos Álvarez
parent 9d679c9b20
commit 238314e606
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -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"
);