9
9
#include <zephyr/kernel.h>
10
10
#include <zephyr/ztest.h>
11
11
12
-
13
12
#define local_abs (x ) (((x) < 0) ? -(x) : (x))
14
13
15
14
#ifndef NAN
@@ -30,11 +29,11 @@ static float test_floats[] = {
30
29
#define NUM_TEST_FLOATS (sizeof(test_floats)/sizeof(float))
31
30
32
31
static double test_doubles [] = {
33
- 1.0 , 2.0 , 3.0 , 4.0 ,
34
- 5.0 , 6.0 , 7.0 , 8.0 , 9.0 , /* numbers across the decade */
35
- 3.14159265359 , 2.718281828 , /* irrational numbers pi and e */
36
- 123.4 , 0.025 , 0.10 , 1.875 /* numbers with infinite */
37
- /* repeating binary representationa */
32
+ 1.0 , 2.0 , 3.0 , 4.0 ,
33
+ 5.0 , 6.0 , 7.0 , 8.0 , 9.0 , /* numbers across the decade */
34
+ 3.14159265359 , 2.718281828 , /* irrational numbers pi and e */
35
+ 123.4 , 0.025 , 0.10 , 1.875 /* numbers with infinite */
36
+ /* repeating binary representationa */
38
37
};
39
38
#define NUM_TEST_DOUBLES (sizeof(test_floats)/sizeof(float))
40
39
@@ -88,13 +87,12 @@ static int isnanf(float x)
88
87
89
88
ZTEST (libc_common , test_sqrtf )
90
89
{
91
- int i ;
92
- float exponent , resf , square , root_squared , error ;
93
- uint32_t max_error ;
94
- int32_t ierror ;
95
- int32_t * p_square = (int32_t * )& square ;
96
- int32_t * p_root_squared = (int32_t * )& root_squared ;
97
-
90
+ int i ;
91
+ float exponent , resf , square , root_squared , error ;
92
+ uint32_t max_error ;
93
+ int32_t ierror ;
94
+ int32_t * p_square = (int32_t * )& square ;
95
+ int32_t * p_root_squared = (int32_t * )& root_squared ;
98
96
99
97
max_error = 0 ;
100
98
@@ -150,13 +148,13 @@ ZTEST(libc_common, test_sqrt)
150
148
if (sizeof (double ) != 8 ) {
151
149
ztest_test_skip ();
152
150
}
153
- int i ;
154
- double resd , error , square , root_squared , exponent ;
155
- uint64_t max_error ;
156
- int64_t ierror ;
157
- int64_t * p_square = (int64_t * )& square ;
158
- int64_t * p_root_squared = (int64_t * )& root_squared ;
159
151
152
+ int i ;
153
+ double resd , error , square , root_squared , exponent ;
154
+ uint64_t max_error ;
155
+ int64_t ierror ;
156
+ int64_t * p_square = (int64_t * )& square ;
157
+ int64_t * p_root_squared = (int64_t * )& root_squared ;
160
158
161
159
max_error = 0 ;
162
160
0 commit comments