#include<math.h>/* nearbyint is the same as rint, but it must not raise the inexact exception */doublenearbyint(doublex){#ifdef FE_INEXACT#pragma STDC FENV_ACCESS ONinte;e=fetestexcept(FE_INEXACT);#endifx=rint(x);#ifdef FE_INEXACTif(!e)feclearexcept(FE_INEXACT);#endifreturnx;}