Nextafter Function


It returns the value of the largest representable floating-point number nearer to the 1st argument , moving towards the 2nd argument.

Syntax:

float nextafterf(float arg1,float arg2);

double nextafter(double arg1,double arg2);

long double nextafterl(long double arg1,long double arg2);

Example:

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

  int main()
  {
     printf("Value of next integer: %f.", nextafter(1.45,2));
     printf("\nValue of next integer: %f.", nextafter(1.45,1));     

  return 0;
  }
   
Back