.\" -*- coding: UTF-8 -*-
.\" Copyright (c) 2000 Andries Brouwer (aeb@cwi.nl)
.\"
.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, see
.\" .
.\" %%%LICENSE_END
.\"
.\" 2000-08-14 added GNU additions from Andreas Jaeger
.\" 2000-12-05 some changes inspired by acahalan's remarks
.\"
.\"*******************************************************************
.\"
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
.TH FENV 3 "15 Septiembre 2017" Linux "Manual del Programador de Linux"
.SH NOMBRE
feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag,
fetestexcept, fegetenv, fegetround, feholdexcept, fesetround, fesetenv,
feupdateenv, feenableexcept, fedisableexcept, fegetexcept \-
file:///home/mariobl/Downloads/manpages\-es\-1.55/po/man3/fenv.3.po
.SH SINOPSIS
.nf
\fB#include \fP
.PP
\fBint feclearexcept(int \fP\fIexcepts\fP\fB);\fP
\fBint fegetexceptflag(fexcept_t *\fP\fIflagp\fP\fB, int \fP\fIexcepts\fP\fB);\fP
\fBint feraiseexcept(int \fP\fIexcepts\fP\fB);\fP
\fBint fesetexceptflag(const fexcept_t *\fP\fIflagp\fP\fB, int \fP\fIexcepts\fP\fB);\fP
\fBint fetestexcept(int \fP\fIexcepts\fP\fB);\fP
.PP
\fBint fegetround(void);\fP
\fBint fesetround(int \fP\fIrounding_mode\fP\fB);\fP
.PP
\fBint fegetenv(fenv_t *\fP\fIenvp\fP\fB);\fP
\fBint feholdexcept(fenv_t *\fP\fIenvp\fP\fB);\fP
\fBint fesetenv(const fenv_t *\fP\fIenvp\fP\fB);\fP
\fBint feupdateenv(const fenv_t *\fP\fIenvp\fP\fB);\fP
.fi
.PP
Enlazar con \fI\-lm\fP.
.SH DESCRIPCIÓN
Estas once funciones fueron definidas dentro de C99 y describen el manejo
del redondeo y de las excepciones (desbordamiento por arriba,
dividir\-por\-cero etc.) en coma flotante.
.SS Excepciones
La excepción «dividir por cero» (\fIdivide\-by\-zero\fP) ocurre cuando una
operación sobre números finitos produce infinito como resultado exacto.
.PP
La excepción «desbordamiento por arriba» (\fIoverflow\fP) ocurre cuando un
resultado tiene que ser representado como un número en coma flotante, pero
su valor absoluto es (mucho) más grande.
.PP
La excepción «desbordamiento por abajo» (\fIunderflow\fP) ocurre cuando un
resultado tiene que ser representado como un número en coma flotante, pero
su valor absoluto es más pequeño que el número positivo en coma flotante
normalizado más pequeño (y se perdería mucha precisión si se representara
como un número desnormalizado).
.PP
The exception «inexacto» (\fIInexact\fP) se produce cuando el resultado
redondeado de una operación no es igual al resultado de precisión
infinita. Puede ocurrir siempre que se produzca un desbordamiento por arriba
(\fIoverflow\fP) o por abajo (\fIunderflow\fP).
.PP
La excepción «inválido» (\fIinvalid\fP) ocurre cuando no hay un resultado
definido para una operación, como por ejemplo 0/0 o infinito \- infinito o
sqrt(\-1).
.SS "Manejo de excepciones"
Las excepciones se representan de dos maneras: como un bit individual
(excepción presente/ausente), que se sitúa dentro de un entero de alguna
manera definida por la implementación, y también como una estructura opaca
que puede contener más información sobre la excepción (tal vez la dirección
dentro del código donde se produjo).
.PP
Cada una de las macros \fBFE_DIVBYZERO\fP, \fBFE_INEXACT\fP, \fBFE_INVALID\fP,
\fBFE_OVERFLOW\fP, \fBFE_UNDERFLOW\fP se define cuando la implementación soporta
el manejo de la correspondiente excepción, definiendose también el bit
correspondiente, de forma que se pueda llamar a las funciones de manejo de
excepciones usando p.e. el argumento entero
\fBFE_OVERFLOW\fP|\fBFE_UNDERFLOW\fP. Otras excepciones pueden estar
soportadas. La macro \fBFE_ALL_EXCEPT\fP está formada mediante un OR lógico con
todos los bits que se corresponden con excepciones soportadas.
.PP
La función \fBfeclearexcept\fP() limpia las excepciones soportadas
representadas por los bits de su argumento.
.PP
La función \fBfegetexceptflag\fP() almacena una representación del estado de
las banderas de excepción representadas por el argumento \fIexcepts\fP en el
objeto opaco \fI*flagp\fP.
.PP
La función \fBferaiseexcept\fP() lanza las excepciones soportadas representadas
por los bits en \fIexcepts\fP.
.PP
La función \fBfesetexceptflag\fP() configura por completo la situación de las
excepciones representadas por \fIexcepts\fP según el valor dado por
\fI*flagp\fP. Este valor debe haber sido obtenido mediante una llamada previa a
\fBfegetexceptflag\fP() con un último argumento que tuviera todos los bits en
\fIexcepts\fP.
.PP
La función \fBfetestexcept\fP() devuelve una palabra en la que los bits activos
son aquellos que estaban activos en el argumento \fIexcepts\fP y para los que
la excepción correspondiente está activa actualmente.
.SS "Rounding mode"
The rounding mode determines how the result of floating\-point operations is
treated when the result cannot be exactly represented in the significand.
Various rounding modes may be provided: round to nearest (the default),
round up (toward positive infinity), round down (toward negative infinity),
and round toward zero.
.PP
Cada una de las macros \fBFE_TONEAREST\fP, \fBFE_UPWARD\fP, \fBFE_DOWNWARD\fP, y
\fBFE_TOWARDZERO\fP se define cuando la implementación soporta el obtener y
establecer la correspondiente dirección de redondeo.
.PP
La función \fBfegetround\fP() devuelve la macro correspondiente al modo actual
de redondeo.
.PP
La función \fBfesetround\fP() fija el modo de redondeo según especifique su
argumento y devuelve cero cuando tiene éxito.
.PP
C99 and POSIX.1\-2008 specify an identifier, \fBFLT_ROUNDS\fP, defined in
\fI\fP, which indicates the implementation\-defined rounding
behavior for floating\-point addition. This identifier has one of the
following values:
.IP \-1
The rounding mode is not determinable.
.IP 0
Rounding is toward 0.
.IP 1
Rounding is toward nearest number.
.IP 2
Rounding is toward positive infinity.
.IP 3
Rounding is toward negative infinity.
.PP
Other values represent machine\-dependent, nonstandard rounding modes.
.PP
The value of \fBFLT_ROUNDS\fP should reflect the current rounding mode as set
by \fBfesetround\fP() (but see BUGS).
.SS "Entorno de coma flotante"
El entorno de coma flotante por completo, incluyendo los modos de control y
las banderas de estado, puede ser manejado como un objeto opaco, de tipo
\fIfenv_t\fP. El entorno por defecto se denota por \fBFE_DFL_ENV\fP (de tipo
\fIconst fenv_t\ *\fP). El entorno por defecto determina la configuración del
entorno al inicio de la ejecución de un programa y, según establece el ISO
C, equivale a redondear al más cercano, tener todas las expeciones
desactivadas y usar un modo de no\-parada (continuar en excepciones).
.PP
La función \fBfegetenv\fP() guarda el entorno de coma flotante actual en el
objeto \fI*envp\fP.
.PP
La función \fBfeholdexcept\fP() hace lo mismo y a continuación limpia todas las
banderas de excepción y establece un modo de no\-parada (continuar en
excepciones), si ésto es posible. Devuelve cero cuando tiene éxito.
.PP
La función \fBfesetenv\fP() restablece el entorno de coma flotante según el
objeto \fI*envp\fP. Debemos asegurarnos de que este objeto es válido, es decir,
de que es el resultado de una llamada a \fBfegetenv\fP() o \fBfeholdexcept\fP() o
de que es igual a \fBFE_DFL_ENV\fP. Ésta llamada no provoca excepciones.
.PP
La función \fBfeupdateenv\fP() instala el entorno de coma flotante representado
por el objeto \fI*envp\fP, pero no desactiva las excepciones actualmente
lanzadas. Tras llamar a esta función, las excepciones lanzadas vendrán dadas
por el resultado de un O\-lógico entre aquellas previamente activas y las que
haya en \fI*envp\fP. Como antes, debemos asegurarnos de que el objeto \fI*envp\fP
es válido.
.SH "VALOR DEVUELTO"
.\" Earlier seven of these functions were listed as returning void.
.\" This was corrected in Corrigendum 1 (ISO/IEC 9899:1999/Cor.1:2001(E))
.\" of the C99 Standard.
These functions return zero on success and nonzero if an error occurred.
.SH VERSIONES
These functions first appeared in glibc in version 2.1.
.SH ATRIBUTOS
Para obtener una explicación de los términos usados en esta sección, véase
\fBattributes\fP(7).
.nh
.ad l
.TS
allbox;
lb lb lb
lw35 l l.
Interfaz Atributo Valor
T{
\fBfeclearexcept\fP(),
\fBfegetexceptflag\fP(),
\fBferaiseexcept\fP(),
\fBfesetexceptflag\fP(),
\fBfetestexcept\fP(),
\fBfegetround\fP(),
\fBfesetround\fP(),
\fBfegetenv\fP(),
\fBfeholdexcept\fP(),
\fBfesetenv\fP(),
\fBfeupdateenv\fP(),
\fBfeenableexcept\fP(),
\fBfedisableexcept\fP(),
\fBfegetexcept\fP()
T} Seguridad del hilo T{
Multi\-hilo seguro
T}
.TE
.ad
.hy
.SH "CONFORME A"
IEC 60559 (IEC 559:1989), ANSI/IEEE 854, C99, POSIX.1\-2001.
.SH NOTAS
.SS "Glibc notes"
If possible, the GNU C Library defines a macro \fBFE_NOMASK_ENV\fP which
represents an environment where every exception raised causes a trap to
occur. You can test for this macro using \fB#ifdef\fP. It is defined only if
\fB_GNU_SOURCE\fP is defined. The C99 standard does not define a way to set
individual bits in the floating\-point mask, for example, to trap on specific
flags. Since version 2.2, glibc supports the functions \fBfeenableexcept\fP()
and \fBfedisableexcept\fP() to set individual floating\-point traps, and
\fBfegetexcept\fP() to query the state.
.PP
.nf
\fB#define _GNU_SOURCE\fP /* Vea feature_test_macros(7) */
\fB#include \fP
.PP
\fBint feenableexcept(int \fP\fIexcepts\fP\fB);\fP
\fBint fedisableexcept(int \fP\fIexcepts\fP\fB);\fP
\fBint fegetexcept(void);\fP
.fi
.PP
Las funciones \fBfeenableexcept\fP() y \fBfedisableexcept\fP() habilitan
(deshabilitan) trampas para cada excepción representada por \fIexcepts\fP y
devuelven el conjunto previo de excepciones habilitadas cuando tienen éxito
y \-1 en caso contrario. La función \fBfegetexcept\fP() devuelve el conjunto de
todas las excepciones habilitadas actualmente.
.SH ERRORES
.\" Aug 08, glibc 2.8
.\" See http://gcc.gnu.org/ml/gcc/2002-02/msg01535.html
C99 specifies that the value of \fBFLT_ROUNDS\fP should reflect changes to the
current rounding mode, as set by \fBfesetround\fP(). Currently, this does not
occur: \fBFLT_ROUNDS\fP always has the value 1.
.SH "VÉASE TAMBIÉN"
\fBmath_error\fP(7)
.SH COLOFÓN
Esta página es parte de la versión 5.10 del proyecto Linux
\fIman\-pages\fP. Puede encontrar una descripción del proyecto, información
sobre cómo informar errores y la última versión de esta página en
\%https://www.kernel.org/doc/man\-pages/.
.SH TRADUCCIÓN
La traducción al español de esta página del manual fue creada por
Miguel Pérez Ibars
.
Esta traducción es documentación libre; lea la
.UR https://www.gnu.org/licenses/gpl-3.0.html
GNU General Public License Version 3
.UE
o posterior con respecto a las condiciones de copyright.
No existe NINGUNA RESPONSABILIDAD.
Si encuentra algún error en la traducción de esta página del manual, envíe un
correo electrónico a
.MT
debian-l10n-spanish@lists.debian.org>.
.ME .