Lines Matching refs:Approx
54 REQUIRE( d == Approx( 1.23 ) );
55 REQUIRE( d != Approx( 1.22 ) );
56 REQUIRE( d != Approx( 1.24 ) );
61 REQUIRE( Approx( d ) == 1.23 );
62 REQUIRE( Approx( d ) != 1.22 );
63 REQUIRE( Approx( d ) != 1.24 );
70 REQUIRE( d != Approx( 1.231 ) );
71 REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) );
78 REQUIRE( d <= Approx( 1.24 ) );
79 REQUIRE( d <= Approx( 1.23 ) );
80 REQUIRE_FALSE( d <= Approx( 1.22 ) );
81 REQUIRE( d <= Approx( 1.22 ).epsilon(0.1) );
88 REQUIRE( d >= Approx( 1.22 ) );
89 REQUIRE( d >= Approx( 1.23 ) );
90 REQUIRE_FALSE( d >= Approx( 1.24 ) );
91 REQUIRE( d >= Approx( 1.24 ).epsilon(0.1) );
96 REQUIRE( 1.23f == Approx( 1.23f ) );
97 REQUIRE( 0.0f == Approx( 0.0f ) );
102 REQUIRE( 1 == Approx( 1 ) );
103 REQUIRE( 0 == Approx( 0 ) );
112 REQUIRE( 1.0f == Approx( 1 ) );
113 REQUIRE( 0 == Approx( dZero) );
114 REQUIRE( 0 == Approx( dSmall ).margin( 0.001 ) );
115 REQUIRE( 1.234f == Approx( dMedium ) );
116 REQUIRE( dMedium == Approx( 1.234f ) );
123 Approx approx = Approx::custom().epsilon( 0.01 );
137 REQUIRE( divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) );
138 REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) );
144 REQUIRE( 104.0 != Approx(100.0) );
145 REQUIRE( 104.0 == Approx(100.0).margin(5) );
146 REQUIRE( 104.0 == Approx(100.0).margin(4) );
147 REQUIRE( 104.0 != Approx(100.0).margin(3) );
148 REQUIRE( 100.3 != Approx(100.0) );
149 REQUIRE( 100.3 == Approx(100.0).margin(0.5) );
153 CHECK( 0.25f == Approx(0.0f).margin(0.25f) );
155 CHECK( 0.0f == Approx(0.25f).margin(0.25f) );
156 CHECK( 0.5f == Approx(0.25f).margin(0.25f) );
158 CHECK( 245.0f == Approx(245.25f).margin(0.25f) );
159 CHECK( 245.5f == Approx(245.25f).margin(0.25f) );
163 REQUIRE_NOTHROW(Approx(0).margin(0));
164 REQUIRE_NOTHROW(Approx(0).margin(1234656));
166 REQUIRE_THROWS_AS(Approx(0).margin(-2), std::domain_error);
168 REQUIRE_NOTHROW(Approx(0).epsilon(0));
169 REQUIRE_NOTHROW(Approx(0).epsilon(1));
171 REQUIRE_THROWS_AS(Approx(0).epsilon(-0.001), std::domain_error);
172 REQUIRE_THROWS_AS(Approx(0).epsilon(1.0001), std::domain_error);
176 REQUIRE(101.000001 != Approx(100).epsilon(0.01));
177 REQUIRE(std::pow(10, -5) != Approx(std::pow(10, -7)));
181 REQUIRE(101.01 != Approx(100).epsilon(0.01));
185 REQUIRE(INFINITY == Approx(INFINITY));
186 REQUIRE(-INFINITY != Approx(INFINITY));
187 REQUIRE(1 != Approx(INFINITY));
188 REQUIRE(INFINITY != Approx(1));
189 REQUIRE(NAN != Approx(NAN));
190 REQUIRE_FALSE(NAN == Approx(NAN));
197 REQUIRE(td == Approx(10.0));
198 REQUIRE(Approx(10.0) == td);
200 REQUIRE(td != Approx(11.0));
201 REQUIRE(Approx(11.0) != td);
203 REQUIRE(td <= Approx(10.0));
204 REQUIRE(td <= Approx(11.0));
205 REQUIRE(Approx(10.0) <= td);
206 REQUIRE(Approx(9.0) <= td);
208 REQUIRE(td >= Approx(9.0));
209 REQUIRE(td >= Approx(td));
210 REQUIRE(Approx(td) >= td);
211 REQUIRE(Approx(11.0) >= td);