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 (Volume 6 of 9): Section 3: Library Functions (A-M) > f

fesetround(3M)

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

fesetround() — set floating-point rounding direction mode

SYNOPSIS

#include <fenv.h>

int fesetround(int round);

DESCRIPTION

The fesetround() function establishes the rounding direction represented by its argument round. The round argument must equal one of the macros FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, and FE_TOWARDZERO. If the argument does not match a rounding direction macro, the rounding direction is not changed.

The default rounding direction mode is round to nearest (FE_TONEAREST).

The ISO/ANSI C committee has approved the fesetround() function for inclusion in the C9X draft standard.

To use this function, compile either with the default -Ae option or with the -Aa and -D_HPUX_SOURCE options. Make sure your program includes <fenv.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.

RETURN VALUE

The fesetround() function returns a zero value if and only if the argument is equal to a rounding direction macro.

ERRORS

No errors are defined.

EXAMPLE

Save, set, and restore the rounding direction.

#include <fenv.h> /*...*/ { int save_round; save_round = fegetround(); fesetround(FE_UPWARD); /*...*/ fesetround(save_round); /*...*/ }

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