Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > L

llrint(3M)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

llrint(), llrintf(), llrintl(), llrintw(), llrintq() — round to nearest long long functions

SYNOPSIS

#include <math.h>

long long llrint(double x);

HP Integrity Server Only

long long llrintf(float x);

long long llrintl(long double x);

long long llrintw(extended x);

long long llrintq(quad x);

DESCRIPTION

llrint() rounds its argument to the nearest integral value, rounding according to the current rounding direction.

llrint() is equivalent to lrint(), except that it rounds to long long instead of long int.

Integrity Server Only

llrintf() is a float version of llrint(); it takes a float argument.

llrintl() is a long double version of llrint(); it takes a long double argument.

llrintw() is an extended version of llrint(); it takes an extended argument.

llrintq() is equivalent to llrintl() on HP-UX systems.

USAGE

To use these functions, compile either with the default -Ae option or with the -Aa and -D_HPUX_SOURCE options.

To use (for Integrity servers) llrintw() or llrintq(), compile also with the -fpwidetypes option.

Make sure your program includes <math.h>. Link in the math library by specifying -lm on the compiler or linker command line.

For more information, see the HP-UX floating-point guide for HP Integrity servers at the following site: http://www.hp.com/go/fp.

RETURN VALUE

If the rounded value is outside the range of long long, the numeric result is the maximum or minimum long long value and the invalid floating-point exception is raised. On Integrity servers, if the rounded value is outside the range of long long, the numeric result is the minimum long long value.

When llrint() raises no other floating-point exception and the result differs from the argument, the function raises the inexact floating-point exception.

ERRORS

No errors are defined.

STANDARDS CONFORMANCE

llrint(), llrintf(), llrintl() : ISO/IEC C99 (including Annex F, ``IEC 60559 floating-point arithmetic'')

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.