Merge branch 'vanduynslagerp-fix-tobecloseto'
- Fixes #1382 Signed-off-by: Alpha Chen <achen@pivotal.io>
This commit is contained in:
@@ -2794,8 +2794,9 @@ getJasmineRequireObj().toBeCloseTo = function() {
|
||||
);
|
||||
}
|
||||
|
||||
var pow = Math.pow(10, precision + 1);
|
||||
return {
|
||||
pass: Math.abs(expected - actual) < (Math.pow(10, -precision) / 2)
|
||||
pass: +(Math.round(Math.abs(expected - actual) * pow) / pow).toFixed(precision + 1) <= (Math.pow(10, -precision) / 2)
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user