Man page - fmodl(3)

Packages contains this manual

Available languages:

en fr pl cs ja ru ro de

Manual

fmod

JMÉNO
KNIHOVNA
POUŽITÍ
POPIS
NÁVRATOVÉ HODNOTY
CHYBOVÉ STAVY
ATRIBUTY
STANDARDY
HISTORIE
CHYBY
PŘÍKLADY
DALŠÍ INFORMACE
PŘEKLAD

JMÉNO

fmod, fmodf, fmodl - desetinná zbytková funkce

KNIHOVNA

Matematická knihovna ( libm , -lm )

POUŽITÍ

#include <math.h>

double fmod(double x , double y );
float fmodf(float
x , float y );
long double fmodl(long double
x , long double y );

Požaduje množinu testovacích maker pro glibc (viz feature_test_macros (7)):

fmodf (), fmodl ():
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
|| /* Od glibc 2.19: */ _DEFAULT_SOURCE
|| /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE

POPIS

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.

To obtain the modulus, more specifically, the Least Positive Residue, you will need to adjust the result from fmod like so:

z = fmod(x, y);
if (z < 0)

z += y;

An alternate way to express this is with fmod(fmod(x, y) + y, y) , but the second fmod () usually costs way more than the one branch.

NÁVRATOVÉ HODNOTY

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 .

Je-li x nebo y NaN, je vráceno NaN.

If x is an infinity, a domain error occurs, and a NaN is returned.

Je-li y nula, je nastavena chyba domény a je vráceno NaN.

Pokud je x +0 (-0) a y není nula je vrácena hodnota +0(-0).

CHYBOVÉ STAVY

Pro více informací zda funkce při svém volání generovala chybu viz math_error (7).

Mohou se objevit následující chyby:
Doménová chyba: x je nekonečno

errno je nastaveno na EDOM (viz CHYBY). Je signalizována výjimka plovoucí čárky ( FE_INVALID ).

Doménová chyba: y je nula

errno je nastaveno na EDOM . Je signalizována výjimka plovoucí čárky ( FE_INVALID ).

ATRIBUTY

Vysvětlení pojmů použitých v této části viz attributes (7).

Image grohtml-4130967-1.png

STANDARDY

C11, POSIX.1-2008.

HISTORIE

C99, POSIX.1-2001.

Varianta vracející double splňuje také SVr4 a 4.3BSD, C89.

CHYBY

Before glibc 2.10, the glibc implementation did not set errno to EDOM when a domain error occurred for an infinite x .

PŘÍKLADY

The call fmod(372, 360) returns 348.

The call fmod(-372, 360) returns -12.

The call fmod(-372, -360) also returns -12.

DALŠÍ INFORMACE

remainder (3)

PŘEKLAD

Překlad této příručky do češtiny vytvořili Pavel Heimlich <tropikhajma@gmail.com>

Tento překlad je bezplatná dokumentace; Přečtěte si GNU General Public License Version 3 nebo novější ohledně podmínek autorských práv. Neexistuje ŽÁDNÁ ODPOVĚDNOST.

Pokud narazíte na nějaké chyby v překladu této příručky, pošlete e-mail na adresu translation-team-cs@lists.sourceforge.net .