C Tutorial/math.h/round


Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /var/www/cppe.ru/www/includes/parser/Preprocessor_DOM.php on line 803

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48
Материал из C\C++ эксперт
Перейти к: навигация, поиск

round

Item Value Header file math.h Declaratoin float roundf(float arg);double round(double arg);long double roundl(long double arg); Return returns the value of arg rounded to the nearest integer.

Values precisely between two values, such as 3.5, are rounded up.


#include <math.h>
  #include <stdio.h>
  int main(void)
  {
    printf("%f\n", round (3.2));
    return 0;
  }