.\" @(#)aint.3m 1.5 93/09/01 SMI; from UCB 4.3 BSD .TH aint 3M "1 Sep 1993" .SH NAME aint, anint, irint, nint \- round to integral value in floating-point or integer format .SH SYNOPSIS .LP .B cc .RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|." .B \-lsunmath -lm .RI "[ " "library" " \|.\|.\|. ]" .LP .B #include .LP .BI "double aint(double " "x" ); .LP .BI "double anint(double " "x" ); .LP .BI "int irint(double " "x" ); .LP .BI "int nint(double " "x" ); .SH DESCRIPTION .IX "aint function" "" "\fLaint\fP \(em aint of" .IX "mathematical functions" aint "" "\fLaint\fP \(em convert to integral floating" .IX "anint function" "" "\fLanint\fP \(em anint of" .IX "mathematical functions" anint "" "\fLanint\fP \(em convert to integral floating" .IX "irint function" "" "\fLirint\fP \(em irint of" .IX "mathematical functions" irint "" "\fLirint\fP \(em convert to integer" .IX "nint function" "" "\fLnint\fP \(em nint of" .IX "mathematical functions" nint "" "\fLnint\fP \(em convert to integer" .LP .B aint(\|) and .B anint(\|) convert a double value into an integral value in .B double format. They differ in how they choose the result when the argument is not already an integral value. Here an \(lqintegral value\(rq means a value of a mathematical integer, which however might be too large to fit in a particular computer's .B int format. All sufficiently large values in a particular floating-point format are already integral; in .SM IEEE double-precision format, that means all values >= 2**52. Zeros, infinities, and quiet NaNs are treated as integral values by these functions, which always preserve their argument's sign. .LP .B aint(\|) returns the integral value between .I x and 0, nearest .IR x . This corresponds to .SM IEEE rounding toward zero and to the Fortran generic intrinsic function .BR aint . .LP .B anint(\|) returns the nearest integral value to .IR x , except halfway cases are rounded to the integral value larger in magnitude. This corresponds to the Fortran generic intrinsic function .BR anint . .LP .B irint(\|) converts .I x into .B int format according to the current .SM IEEE rounding direction. .LP .B nint(\|) converts .I x into .B int format rounding to the nearest int value, except halfway cases are rounded to the int value larger in magnitude. This corresponds to the Fortran generic intrinsic function .BR nint . .SH "SEE ALSO" .BR floor (3M)