[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 2

trunc, truncf, or truncl Subroutine

Purpose

Rounds to truncated integer value.

Syntax

#include <math.h>

double trunc (x)
double x;

float truncf (x)
float x;

long double truncl (x)
long double x;

Description

The trunc, truncf, and truncl subroutines round the x parameter to the integer value, in floating format, nearest to but no larger in magnitude than the x parameter.

Parameters

x Specifies the value to be rounded.

Return Values

Upon successful completion, the trunc, truncf, and truncl subroutines return the truncated integer value.

If x is NaN, a NaN is returned.

If x is ±0 or ±Inf, x is returned.

Related Information

math.h in AIX 5L Version 5.2 Files Reference.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]