Skip to content

Commit

Permalink
use 10 ** -decimalPlaces (as-pect#360)
Browse files Browse the repository at this point in the history
LGTM!
  • Loading branch information
MaxGraey committed Jun 19, 2021
1 parent ec2fa30 commit 4303217
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/assembly/assembly/internal/Expectation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export class Expectation<T> {

// calculated: `|expected - actual| < 1 / numberOfDigits`.
// @ts-ignore tooling errors because T does not extend a numeric value type. This compiles just fine.
let isClose = i32(abs(expected - actual) < Math.pow(0.1, decimalPlaces));
let isClose = i32(abs(expected - actual) < Math.pow(10, -decimalPlaces));
assert(negated ^ isClose, message);
Actual.clear();
Expected.clear();
Expand Down

0 comments on commit 4303217

Please sign in to comment.