Content-type: text/html Man page of itrunc

itrunc

Section: C Library Functions (3)
Index Return to Main Contents

 

NAME

itrunc, uitrunc - Truncate a floating-point number  

LIBRARY

Standard C Library (libc.a)  

SYNOPSIS

int itrunc(
     double x); unsigned int uitrunc(
     double x);  

DESCRIPTION

The itrunc function returns the signed integer nearest to the double-precision floating value x in the direction of 0.0. This effectively truncates x by discarding its fraction component. The uitrunc function also truncates the double x, but returns an unsigned integer value.

If x is a NaN or a negative value that exceeds the size of a signed integer, itrunc returns INT_MIN. If x is a positive value that exceeds the size of a signed integer, itrunc returns INT_MAX.

If x is a NaN or a negative value that exceeds the size of an unsigned integer, uitrunc returns a zero. If x is a positive value that exceeds the size of an unsigned integer, itrunc returns UINT_MAX.

 

RELATED INFORMATION

Files: limits.h, math.h, float.h, fp.h, machine/fpu.h.

IEEE Standard for Binary Floating-Point Arithmetic delim off


 

Index

NAME
LIBRARY
SYNOPSIS
DESCRIPTION
RELATED INFORMATION

This document was created by man2html, using the manual pages.
Time: 02:42:03 GMT, October 02, 2010