approximately

.approximately is a word indicating an approximate value comparison. When using .approximately, only the words .be and .equal may be used, though they may appear before or after. Each must be called with an additional parameter, error = <float>, indicating the amount of permissible error.

approximately
(
Should
)
(
Should should
,
double expected
,
ErrorValue error
,
Fence _ = Fence()
,
string file = __FILE__
,
size_t line = __LINE__
)
if (
isInstanceOf!(ShouldType, Should)
)

Examples

1 5.should.be.approximately(5.1, error = 0.11);
2 5.should.approximately.be(5.1, error = 0.11);
3 0.should.approximately.equal(1.0, error = 1.1);
4 0.should.approximately.equal(-1.0, error = 1.1);
5 0.should.not.approximately.equal(1, error = 0.1);
6 42.3.should.be.approximately(42.3, error = 1e-3);

Meta