trunc(3) Library Functions Manual trunc(3)

trunc, truncf, truncl - redondeo a entero, hacia cero

Biblioteca Matemática (libm, -lm)

#include <math.h>
double trunc(double x);
float truncf(float x);
long double truncl(long double x);
Requisitos de Macros de Prueba de Características para glibc (véase feature_test_macros(7)):

trunc(), truncf(), truncl():

    _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L

These functions round x to the nearest integer value that is not larger in magnitude than x.

These functions return the rounded integer value, in floating format.

Si x es entero, infinito o NaN, se devuelve x tal cual.

No suceden errores.

Para obtener una explicación de los términos usados en esta sección, véase attributes(7).

Interfaz Atributo Valor
trunc(), truncf(), truncl() Seguridad del hilo Multi-hilo seguro

C11, POSIX.1-2008.

glibc 2.1. C99, POSIX.1-2001.

The integral value returned by these functions may be too large to store in an integer type (int, long, etc.). To avoid an overflow, which will produce undefined results, an application should perform a range check on the returned value before assigning it to an integer type.

ceil(3), floor(3), lrint(3), nearbyint(3), rint(3), round(3)

La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars <mpi79470@alu.um.es>

Esta traducción es documentación libre; lea la GNU General Public License Version 3 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 debian-l10n-spanish@lists.debian.org.

31 Octubre 2023 Páginas de manual de Linux 6.06