·  Home
+   man pages
 -> Linux -> FreeBSD -> OpenBSD -> NetBSD -> Tru64 Unix -> HP-UX 11i -> IRIX
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

man pages->Tru64 Unix man pages -> itrunc (3)
 Title
 Content
 Arch
 Section All Sections 1 - General Commands 2 - System Calls 3 - Subroutines 4 - Special Files 5 - File Formats 6 - Games 7 - Macros and Conventions 8 - Maintenance Commands 9 - Kernel Interface n - New Commands

## itrunc(3)

```
```

### NAME[Toc][Back]

```       itrunc, uitrunc - truncate a floating-point number
```

### SYNOPSIS[Toc][Back]

```       #include <math.h>

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

### LIBRARY[Toc][Back]

```       Standard C Library (libc.a)
```

### DESCRIPTION[Toc][Back]

```       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.
```

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

IEEE Standard for Binary Floating-Point Arithmetic

itrunc(3)
```
[ Back ]
Similar pages
 Name OS Title fpclassify FreeBSD classify a floating-point number isfinite FreeBSD classify a floating-point number isinf FreeBSD classify a floating-point number isnan FreeBSD classify a floating-point number isnormal FreeBSD classify a floating-point number fabs Linux absolute value of floating-point number gcvt Linux convert a floating-point number to a string. ecvt Linux convert a floating-point number to a string. isnan IRIX determine type of floating-point number ecvt IRIX convert floating-point number to string