Provided by: manpages-pt-br-dev_4.15.0-9_all
NOME
nearbyint, nearbyintf, nearbyintl, rint, rintf, rintl - arredonda para o inteiro mais próximo
SINOPSE
#include <math.h> double nearbyint(double x); float nearbyintf(float x); long double nearbyintl(long double x); double rint(double x); float rintf(float x); long double rintl(long double x); Vincule com -lm. Requisitos de macro de teste de recursos para o glibc (consulte feature_test_macros(7)): nearbyint(), nearbyintf(), nearbyintl(): _POSIX_C_SOURCE >= 200112L || _ISOC99_SOURCE rint(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 500 || /* Desde o glibc 2.19: */ _DEFAULT_SOURCE || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE rintf(), rintl(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || /* Desde o glibc 2.19: */ _DEFAULT_SOURCE || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
DESCRIÇÃO
The nearbyint(), nearbyintf(), and nearbyintl() functions round their argument to an integer value in floating-point format, using the current rounding direction (see fesetround(3)) and without raising the inexact exception. When the current rounding direction is to nearest, these functions round halfway cases to the even integer in accordance with IEEE-754. The rint(), rintf(), and rintl() functions do the same, but will raise the inexact exception (FE_INEXACT, checkable via fetestexcept(3)) when the result differs in value from the argument.
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.
ATRIBUTOS
Para uma explicação dos termos usados nesta seção, consulte attributes(7). ┌───────────────────────────────────────────────────────────────┬───────────────┬─────────┐ │Interface │ Atributo │ Valor │ ├───────────────────────────────────────────────────────────────┼───────────────┼─────────┤ │nearbyint(), nearbyintf(), nearbyintl(), rint(), rintf(), │ Thread safety │ MT-Safe │ │rintl() │ │ │ └───────────────────────────────────────────────────────────────┴───────────────┴─────────┘
DE ACORDO COM
C99, POSIX.1-2001, POSIX.1-2008.
NOTAS
SUSv2 e POSIX.1-2001 contêm um texto sobre 'overflow' (que pode definir errno para ERANGE ou levanta uma exceção FE_OVERFLOW). Na prática, o resultado não pode 'overflow' em qualquer máquina, assim esta coisa de manipulação de erros não tem sentido. (Mais precisamente, 'overflow' somente ocorre quando o valor máximo de um expoente é menor que o número de bits da mantissa. Para, o padronização IEEE-754, os números em ponto flutuante de 32 bits e 64 bits o valor máximo do expoente é 128 (respectivamente, 1024) e o de bits da mantissa é 24 (respectivamente, 53)). If you want to store the rounded value in an integer type, you probably want to use one of the functions described in lrint(3) instead.
VEJA TAMBÉM
ceil(3), floor(3), lrint(3), round(3), trunc(3)
COLOFÃO
Esta página faz parte da versão 5.13 do projeto Linux man-pages. Uma descrição do projeto, informações sobre relatórios de bugs e a versão mais recente desta página podem ser encontradas em https://www.kernel.org/doc/man-pages/.
TRADUÇÃO
A tradução para português brasileiro desta página man foi criada por Marcelo Pereira da Silva <marcelo@pereira.com> e André Luiz Fassone <lonely_wolf@ig.com.br> Esta tradução é uma documentação livre; leia a Licença Pública Geral GNU Versão 3 ⟨https://www.gnu.org/licenses/gpl-3.0.html⟩ 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 ⟨debian-l10n-portuguese@lists.debian.org⟩. 22 março 2021 RINT(3)