nextafter : nextafter « math.h « C Tutorial






ItemValue
Header filemath.h
Declarationfloat nextafterf(float from, float towards);
double nextafter(double from, double towards);
long double nextafterl(long double from, long double towards);
Returnreturns the next value after 'from' that is closer to 'towards'.


#include <math.h>
  #include <stdio.h>

  int main(void)
  {
     double f;

     f = nextafter(2.3,1.2);
    
     printf("%f " , f);
  }
2.300000








19.54.nextafter
19.54.1.nextafter