fmod, fmodf, fmodl - função de resto de divisão para ponto flutuante
Biblioteca matemática (libm, -lm)
#include <math.h>
double fmod(double x, double y);
float fmodf(float x, float y);
long double fmodl(long double x, long double y);
fmodf(), fmodl():
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
|| /* Desde o glibc 2.19: */ _DEFAULT_SOURCE
|| /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE These functions compute the floating-point remainder of dividing x by y. The return value is x - n * y, where n is the quotient of x / y, rounded toward zero to an integer.
On success, these functions return the value x - n*y, for some integer n, such that the returned value has the same sign as x and a magnitude less than the magnitude of y.
If x or y is a NaN, a NaN is returned.
If x is an infinity, a domain error occurs, and a NaN is returned.
If y is zero, a domain error occurs, and a NaN is returned.
If x is +0 (-0), and y is not zero, +0 (-0) is returned.
Consulte math_error(7)EN para obter informações sobre como determinar se ocorreu um erro ao chamar essas funções.
Os seguintes erros podem ocorrer:
- Domain error: x is an infinity
- errno é definido com EDOM (mas veja BUGS). Uma exceção de ponto flutuante inválido (FE_INVALID) é levantada.
- Domain error: y is zero
- errno é definido com EDOM. Uma exceção de ponto flutuante inválida (FE_INVALID) é levantada.
Para uma explicação dos termos usados nesta seção, consulte attributes(7)EN.
| Interface | Atributo | Valor |
| fmod(), fmodf(), fmodl() | Thread safety | MT-Safe |
C99, POSIX.1-2001, POSIX.1-2008.
A variante retornando double também está em conformidade com SVr4, 4.3BSD.
Before glibc 2.10, the glibc implementation did not set errno to EDOM when a domain error occurred for an infinite x.
A tradução para português brasileiro desta página man foi criada por Rubens de Jesus Nogueira <darkseid99@usa.net> 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 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.