...
Code Block | ||||
---|---|---|---|---|
| ||||
#include <float.h> #include <math.h> void func(double d_a, long double big_d) { double d_b; float f_a; float f_b; if (isgreater(fabs(d_a), FLT_MAX) || isless(fabs(d_a), FLT_MIN)) { /* Handle error */ } else { f_a = (float)d_a; } if (isgreater(fabsl(big_d), FLT_MAX) || isless(fabsl(big_d), FLT_MIN)) { /* Handle error */ } else { f_b = (float)big_d; } if (isgreater (fabsl(big_d), DBL_MAX) || isless(fabsl(big_d), DBL_MIN)) { /* Handle error */ } else { d_b = (double)big_d; } } |
...