C Tutorial/math.h/nextafter

Материал из C\C++ эксперт
Перейти к: навигация, поиск

nextafter

Item Value Header file math.h Declaration float nextafterf(float from, float towards);double nextafter(double from, double towards);long double nextafterl(long double from, long double towards); Return returns the next value after "from" that is closer to "towards".


<source lang="cpp">#include <math.h>

 #include <stdio.h>
 int main(void)
 {
    double f;
    f = nextafter(2.3,1.2);
   
    printf("%f " , f);
 }</source>