Changeset b2acdf32 in mainline
- Timestamp:
- 2018-08-29T20:05:52Z (7 years ago)
- Children:
- 184ff675
- Parents:
- b1b201f
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-29 15:48:16)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-29 20:05:52)
- Location:
- uspace
- Files:
-
- 4 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/float/float2.c
rb1b201f rb2acdf32 43 43 }; 44 44 45 static double arguments_atan[OPERANDS] = {46 3.5, 100.0, 50.0, 768.3156, 1080.499999, 1.0, 66.0,47 2.718281828459045, 9.9, 0.00148 };49 50 45 static double arguments_exp[OPERANDS] = { 51 46 3.5, -2.1, 50.0, 0.0, 1.0, 13.2, -1.1, -5.5, 0.1, -66.0 … … 64 59 static double arguments_tanh[OPERANDS] = { 65 60 3.5, -2.1, 50.0, 0.0, 1.0, 13.2, -1.1, -5.5, 0.000001, -66000000.0 66 };67 68 static double results_atan[OPERANDS] = {69 1.292496667790, 1.560796660108, 1.550798992822, 1.569494779052,70 1.569870829603, 0.785398163397, 1.555645970920, 1.218282905017,71 1.470127674637, 0.00099999966772 61 }; 73 62 … … 193 182 194 183 for (unsigned int i = 0; i < OPERANDS; i++) { 195 double res = atan(arguments_atan[i]);196 197 if (!cmp_double(res, results_atan[i])) {198 TPRINTF("Double precision atan failed "199 "(%.12lf != %.12lf, arg %u)\n", res, results_atan[i], i);200 fail = true;201 }202 }203 204 for (unsigned int i = 0; i < OPERANDS; i++) {205 float res = atanf(arguments_atan[i]);206 207 if (!cmp_float(res, results_atan[i])) {208 TPRINTF("Single precision atan failed "209 "(%f != %lf, arg %u)\n", res, results_atan[i], i);210 fail = true;211 }212 }213 214 for (unsigned int i = 0; i < OPERANDS; i++) {215 184 double res = ceil(arguments[i]); 216 185 -
uspace/lib/math/Makefile
rb1b201f rb2acdf32 34 34 35 35 SOURCES = \ 36 generic/atan.c \37 generic/atan2.c \38 36 generic/ceil.c \ 39 37 generic/cosh.c \ -
uspace/lib/math/include/math.h
rb1b201f rb2acdf32 37 37 #define LIBMATH_MATH_H_ 38 38 39 #include <atan.h>40 #include <atan2.h>41 39 #include <ceil.h> 42 40 #include <cosh.h> … … 62 60 #define HUGE_VAL FLOAT64_INF 63 61 64 static inline float64_t atan_f64(float64_t val)65 {66 return float64_atan(val);67 }68 69 static inline float32_t atan_f32(float32_t val)70 {71 return float32_atan(val);72 }73 74 static inline float64_t atan2_f64(float64_t y, float64_t x)75 {76 return float64_atan2(y, x);77 }78 79 static inline float32_t atan2_f32(float32_t y, float32_t x)80 {81 return float32_atan2(y, x);82 }83 84 62 static inline float64_t ceil_f64(float64_t val) 85 63 { … … 279 257 { 280 258 return float32_trunc(val); 281 }282 283 static inline float64_t atan(float64_t val)284 {285 return atan_f64(val);286 }287 288 static inline float32_t atanf(float32_t val)289 {290 return atan_f32(val);291 }292 293 static inline float64_t atan2(float64_t y, float64_t x)294 {295 return atan2_f64(y, x);296 }297 298 static inline float32_t atan2f(float32_t y, float32_t x)299 {300 return atan2_f32(y, x);301 259 } 302 260
Note:
See TracChangeset
for help on using the changeset viewer.