File tree Expand file tree Collapse file tree 2 files changed +7
-21
lines changed
src/__support/fixed_point Expand file tree Collapse file tree 2 files changed +7
-21
lines changed Original file line number Diff line number Diff line change @@ -224,8 +224,8 @@ idiv(T x, T y) {
224
224
return static_cast <XType>(result);
225
225
}
226
226
227
- inline long accum nrstep (long accum d, long accum x0) {
228
- auto v = x0 * (2 - (d * x0));
227
+ LIBC_INLINE long accum nrstep (long accum d, long accum x0) {
228
+ auto v = x0 * (2 . lk - (d * x0));
229
229
return v;
230
230
}
231
231
Original file line number Diff line number Diff line change @@ -21,25 +21,11 @@ class DivITest : public LIBC_NAMESPACE::testing::Test {
21
21
typedef XType (*DivIFunc)(int , int );
22
22
23
23
void testBasic (DivIFunc func) {
24
- auto c1 = func (2 , 3 );
25
- auto e1 = 0.666666 ;
26
- EXPECT_EQ (static_cast <XType>(c1), static_cast <XType>(e1 ));
27
-
28
- c1 = func (3 , 4 );
29
- e1 = 0.75 ;
30
- EXPECT_EQ (static_cast <XType>(c1), static_cast <XType>(e1 ));
31
-
32
- c1 = func (1043 , 2764 );
33
- e1 = 0.37735 ;
34
- EXPECT_EQ (static_cast <XType>(c1), static_cast <XType>(e1 ));
35
-
36
- c1 = func (60000 , 720293 );
37
- e1 = 0.083299 ;
38
- EXPECT_EQ (static_cast <XType>(c1), static_cast <XType>(e1 ));
39
-
40
- c1 = func (7 , 3 );
41
- e1 = 2.33333 ;
42
- EXPECT_EQ (static_cast <XType>(c1), static_cast <XType>(e1 ));
24
+ EXPECT_EQ (static_cast <XType>(func (128 ,256 )), static_cast <XType>(0.5 ));
25
+ EXPECT_EQ (static_cast <XType>(func (2 ,3 )), static_cast <XType>(0.666666 ));
26
+ EXPECT_EQ (static_cast <XType>(func (3 ,4 )), static_cast <XType>(0.75 ));
27
+ EXPECT_EQ (static_cast <XType>(func (1043 , 2764 )), static_cast <XType>(0.37735 ));
28
+ EXPECT_EQ (static_cast <XType>(func (60000 , 720293 )), static_cast <XType>(0.083299 ));
43
29
}
44
30
};
45
31
You can’t perform that action at this time.
0 commit comments