Asserts that value is close to the expected by floating point precision.
For example, the following fails because arithmetic on decimal (base 10) values often have rounding errors in limited precision binary (base 2) representation.
Symbol
Asserts that value is close to the expected by floating point precision.
For example, the following fails because arithmetic on decimal (base 10) values often have rounding errors in limited precision binary (base 2) representation.
the expected value
the number of digits to check after the decimal point. Default is 2
expect(0.2 + 0.1).toBe(0.3); // fails
Use `toBeCloseTo` to compare floating point numbers for approximate equality.