Provided by: manpages-pt-br-dev_4.21.0-2_all bug

NOME

       round, roundf, roundl - arredonda para o número inteiro mais próximo, distante de zero

BIBLIOTECA

       Biblioteca matemática (libm, -lm)

SINOPSE

       #include <math.h>

       double round(double x);
       float roundf(float x);
       long double roundl(long double x);

   Requisitos de macro de teste de recursos para o glibc (consulte feature_test_macros(7)):

       round(), roundf(), roundl():
           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L

DESCRIÇÃO

       Estas  funções  arredondam x para o número inteiro mais próximo, mas parcialmente casos distantes de zero
       (independente da direção de arredondamento atual, veja fenv(3)), ao invés de  arredondar  para  o  número
       inteiro par como rint(3).

       Por exemplo, round(0.5) é 1.0 e round(-0.5) é -1.0.

VALOR DE RETORNO

       Estas funções retornar um valor inteiro arredondado.

       Se x é integral, +0, -0, NaN ou infinito, o próprio x é retornado.

ERROS

       Ocorre nenhum erro. POSIX.1-2001 documenta um erro de intervalo para estouros, mas consulte NOTAS.

VERSÕES

       These functions were added in glibc 2.1.

ATRIBUTOS

       Para uma explicação dos termos usados nesta seção, consulte attributes(7).
       ┌─────────────────────────────────────────────────────────────────────────────┬───────────────┬─────────┐
       │ InterfaceAtributoValor   │
       ├─────────────────────────────────────────────────────────────────────────────┼───────────────┼─────────┤
       │ round(), roundf(), roundl()                                                 │ Thread safety │ MT-Safe │
       └─────────────────────────────────────────────────────────────────────────────┴───────────────┴─────────┘

PADRÕES

       C99, POSIX.1-2001, POSIX.1-2008.

NOTAS

       POSIX.1-2001  contains  text  about  overflow  (which  might set errno to ERANGE, or raise an FE_OVERFLOW
       exception).  In practice, the result cannot overflow on any current machine, so this error-handling stuff
       is just nonsense.  (More precisely, overflow can happen only when the maximum value of  the  exponent  is
       smaller  than  the  number  of mantissa bits.  For the IEEE-754 standard 32-bit and 64-bit floating-point
       numbers the maximum value of the exponent is 127 (respectively, 1023), and the number  of  mantissa  bits
       including the implicit bit is 24 (respectively, 53).)

       Se  você  deseja  armazenar  o  valor  arredondado  em um tipo inteiro, provavelmente deseja usar uma das
       funções descritas em lround(3).

VEJA TAMBÉM

       ceil(3), floor(3), lround(3), nearbyint(3), rint(3), trunc(3)

TRADUÇÃO

       A tradução para português brasileiro desta página man foi criada por Mila <misfit@linuxbr.com.br>,  André
       Luiz Fassone <lonely_wolf@ig.com.br> e Rafael Fontenelle <rafaelff@gnome.org>.

       Esta  tradução  é  uma documentação livre; leia a Licença Pública Geral GNU Versão 3 ou posterior para as
       condições de direitos autorais.  Nenhuma responsabilidade é aceita.

       Se você encontrar algum erro na tradução  desta  página  de  manual,  envie  um  e-mail  para  a lista de
       discussão de tradutores.

Linux man-pages 6.03                            15 dezembro 2022                                        round(3)