mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:42:58 +00:00
[CRT]
Fix error handling for j0, j1, y0, y1 Bessel functions. Remove useless defines svn path=/trunk/; revision=54552
This commit is contained in:
parent
5a339d9479
commit
054f2fe7ce
2 changed files with 14 additions and 8 deletions
|
@ -2,8 +2,6 @@
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include "ieee754/ieee754.h"
|
#include "ieee754/ieee754.h"
|
||||||
|
|
||||||
typedef int fpclass_t;
|
|
||||||
fpclass_t _fpclass(double __d);
|
|
||||||
int *_errno(void);
|
int *_errno(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -11,7 +9,7 @@ int *_errno(void);
|
||||||
*/
|
*/
|
||||||
double _j0(double num)
|
double _j0(double num)
|
||||||
{
|
{
|
||||||
/* FIXME: errno handling */
|
if (!_finite(num)) *_errno() = EDOM;
|
||||||
return __ieee754_j0(num);
|
return __ieee754_j0(num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +19,12 @@ double _j0(double num)
|
||||||
double _y0(double num)
|
double _y0(double num)
|
||||||
{
|
{
|
||||||
double retval;
|
double retval;
|
||||||
if (!_finite(num)) *_errno() = EDOM;
|
int fpclass = _fpclass(num);
|
||||||
|
|
||||||
|
if (!_finite(num) || fpclass == _FPCLASS_NN ||
|
||||||
|
fpclass == _FPCLASS_ND || fpclass == _FPCLASS_NZ)
|
||||||
|
*_errno() = EDOM;
|
||||||
|
|
||||||
retval = __ieee754_y0(num);
|
retval = __ieee754_y0(num);
|
||||||
if (_fpclass(retval) == _FPCLASS_NINF)
|
if (_fpclass(retval) == _FPCLASS_NINF)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include "ieee754/ieee754.h"
|
#include "ieee754/ieee754.h"
|
||||||
|
|
||||||
typedef int fpclass_t;
|
|
||||||
fpclass_t _fpclass(double __d);
|
|
||||||
int *_errno(void);
|
int *_errno(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -11,7 +9,7 @@ int *_errno(void);
|
||||||
*/
|
*/
|
||||||
double _j1(double num)
|
double _j1(double num)
|
||||||
{
|
{
|
||||||
/* FIXME: errno handling */
|
if (!_finite(num)) *_errno() = EDOM;
|
||||||
return __ieee754_j1(num);
|
return __ieee754_j1(num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +19,12 @@ double _j1(double num)
|
||||||
double _y1(double num)
|
double _y1(double num)
|
||||||
{
|
{
|
||||||
double retval;
|
double retval;
|
||||||
if (!_finite(num)) *_errno() = EDOM;
|
int fpclass = _fpclass(num);
|
||||||
|
|
||||||
|
if (!_finite(num) || fpclass == _FPCLASS_NN ||
|
||||||
|
fpclass == _FPCLASS_ND || fpclass == _FPCLASS_NZ)
|
||||||
|
*_errno() = EDOM;
|
||||||
|
|
||||||
retval = __ieee754_y1(num);
|
retval = __ieee754_y1(num);
|
||||||
if (_fpclass(retval) == _FPCLASS_NINF)
|
if (_fpclass(retval) == _FPCLASS_NINF)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue