1 #include <math.h> 2 #include <float.h> 3 #include "ieee754/ieee754.h" 4 5 typedef int fpclass_t; 6 fpclass_t _fpclass(double __d); 7 int *_errno(void); 8 9 /* 10 * @unimplemented 11 */ 12 double _jn(int n, double num) 13 { 14 /* FIXME: errno handling */ 15 return __ieee754_jn(n, num); 16 } 17 18 /* 19 * @implemented 20 */ 21 double _yn(int order, double num) 22 { 23 double retval; 24 if (!_finite(num)) *_errno() = EDOM; 25 retval = __ieee754_yn(order,num); 26 if (_fpclass(retval) == _FPCLASS_NINF) 27 { 28 *_errno() = EDOM; 29 retval = sqrt(-1); 30 } 31 return retval; 32 } 33