1 #include <math.h> 2 #include <float.h> 3 #include "ieee754/ieee754.h" 4 5 int *_errno(void); 6 7 /* 8 * @unimplemented 9 */ 10 double _j0(double num) 11 { 12 if (!_finite(num)) *_errno() = EDOM; 13 return __ieee754_j0(num); 14 } 15 16 /* 17 * @implemented 18 */ 19 double _y0(double num) 20 { 21 double retval; 22 int fpclass = _fpclass(num); 23 24 if (!_finite(num) || fpclass == _FPCLASS_NN || 25 fpclass == _FPCLASS_ND || fpclass == _FPCLASS_NZ) 26 *_errno() = EDOM; 27 28 retval = __ieee754_y0(num); 29 if (_fpclass(retval) == _FPCLASS_NINF) 30 { 31 *_errno() = EDOM; 32 retval = sqrt(-1); 33 } 34 return retval; 35 } 36