C/math.h/nexttoward

Материал из C\C++ эксперт
Версия от 10:22, 25 мая 2010; Admin (обсуждение | вклад) (1 версия: Импорт контента...)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

nexttoward: returns the next value after "from" that is closer to "towards"

    
//Declaration: float nexttowardf(float from, long double towards); 
               double nexttoward(double from, long double towards); 
               long double nexttowardl(long double from, long double towards);  
 
    
  
 
  #include <math.h>
  #include <stdio.h>
  int main(void)
  {
      double f;
      f = nexttoward (2.3,1.2);
     
      printf("%f " , f);
  }