2002-06-13 18:20:48 +08:00
|
|
|
#include <fenv.h>
|
|
|
|
|
|
|
|
/* 7.6.2.1
|
|
|
|
The feclearexcept function clears the supported exceptions
|
|
|
|
represented by its argument. */
|
|
|
|
|
2005-08-25 16:39:54 +08:00
|
|
|
int feclearexcept (int excepts)
|
2002-06-13 18:20:48 +08:00
|
|
|
{
|
|
|
|
fenv_t _env;
|
|
|
|
__asm__ volatile ("fnstenv %0;" : "=m" (_env)); /* get the env */
|
|
|
|
_env.__status_word &= ~(excepts & FE_ALL_EXCEPT); /* clear the except */
|
|
|
|
__asm__ volatile ("fldenv %0;" :: "m" (_env)); /*set the env */
|
2005-08-25 16:39:54 +08:00
|
|
|
|
|
|
|
return 0;
|
2002-06-13 18:20:48 +08:00
|
|
|
}
|