frexp(3) | Library Functions Manual | frexp(3) |
NOM
frexp, frexpf, frexpl - Conversion de réel en fraction normalisée
BIBLIOTHÈQUE
Bibliothèque de math (libm, -lm)
SYNOPSIS
#include <math.h>
double frexp(double x, int *e); float frexpf(float x, int *e); long double frexpl(long double x, int *e);
frexpf(), frexpl() :
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || /* Depuis la glibc 2.19 : */ _DEFAULT_SOURCE || /* glibc <= 2.19 : */ _BSD_SOURCE || _SVID_SOURCE
DESCRIPTION
These functions are used to split the number x into a normalized fraction and an exponent which is stored in e.
VALEUR RENVOYÉE
Ces fonctions renvoient la fraction normalisée. Si l'argument x est non nul, la fraction normalisée est x multiplié par une puissance de deux et sa valeur absolue est comprise dans l'intervalle 1/2 (inclus) et 1 (exclu), c'est-à-dire [0,5-1].
If x is zero, then the normalized fraction is zero and zero is stored in e.
If x is a NaN, a NaN is returned, and the value of *e is unspecified.
If x is positive infinity (negative infinity), positive infinity (negative infinity) is returned, and the value of *e is unspecified.
ERREURS
Aucune erreur n'est survenue'
ATTRIBUTS
Pour une explication des termes utilisés dans cette section, consulter attributes(7).
Interface | Attribut | Valeur |
frexp(), frexpf(), frexpl() | Sécurité des threads | MT-Safe |
STANDARDS
C11, POSIX.1-2008.
HISTORIQUE
C99, POSIX.1-2001.
La variante renvoyant double est également conforme à SVr4, 4.3BSD et C89.
EXEMPLES
Le programme ci-dessous affiche les résultats suivants :
$ ./a.out 2560 frexp(2560, &e) = 0.625: 0.625 * 2^12 = 2560 $ ./a.out -4 frexp(-4, &e) = -0.5: -0.5 * 2^3 = -4
Source du programme
#include <float.h> #include <math.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { double x, r; int e; x = strtod(argv[1], NULL); r = frexp(x, &e); printf("frexp(%g, &e) = %g: %g * %d^%d = %g\n", x, r, r, 2, e, x); exit(EXIT_SUCCESS); }
VOIR AUSSI
TRADUCTION
La traduction française de cette page de manuel a été créée par Christophe Blaess https://www.blaess.fr/christophe/, Stéphan Rafin <stephan.rafin@laposte.net>, Thierry Vignaud <tvignaud@mandriva.com>, François Micaux, Alain Portal <aportal@univ-montp2.fr>, Jean-Philippe Guérard <fevrier@tigreraye.org>, Jean-Luc Coulon (f5ibh) <jean-luc.coulon@wanadoo.fr>, Julien Cristau <jcristau@debian.org>, Thomas Huriaux <thomas.huriaux@gmail.com>, Nicolas François <nicolas.francois@centraliens.net>, Florentin Duneau <fduneau@gmail.com>, Simon Paillard <simon.paillard@resel.enst-bretagne.fr>, Denis Barbier <barbier@debian.org>, David Prévot <david@tilapin.org>, Cédric Boutillier <cedric.boutillier@gmail.com> et Jean-Pierre Giraud <jean-pierregiraud@neuf.fr>
Cette traduction est une documentation libre ; veuillez vous reporter à la GNU General Public License version 3 concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE.
Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à debian-l10n-french@lists.debian.org.
19 juillet 2025 | Pages du manuel de Linux 6.15 |