C Tutorial/math.h/nearbyint — различия между версиями

Материал из C\C++ эксперт
Перейти к: навигация, поиск
м (1 версия: Импорт контента...)
 
м (1 версия: Импорт контента...)
 
(нет различий)

Текущая версия на 13:32, 25 мая 2010

nearbyint

Item Value Header file math.h Declaration float nearbyintf(float arg);double nearbyint(double arg);long double nearbyintl(long double arg); Return returns the value of arg rounded to the nearest integer.


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

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