Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

floor(3) [opendarwin man page]

FLOOR(3)						   BSD Library Functions Manual 						  FLOOR(3)

floor -- round to largest integral value not greater than x SYNOPSIS
#include <math.h> double floor(double x); float floorf(float x); DESCRIPTION
The floor() and floorf() functions return the largest integral value less than or equal to x. SPECIAL VALUES
floor(+-0) returns +-0. floor(+-infinity) returns +-infinity. SEE ALSO
abs(3), ceil(3), fabs(3), ieee(3), rint(3), math(3) STANDARDS
The floor() and floorf() functions conform to ISO/IEC 9899:1999(E). BSD
November 20, 2002 BSD

Check Out this Related Man Page

floor(3M)						  Mathematical Library Functions						 floor(3M)

floor, floorf, floorl - floor function SYNOPSIS
cc [ flag... ] file... -lm [ library... ] #include <math.h> double floor(double x); float floorf(float x); long double floorl(long double x); DESCRIPTION
These functions compute the largest integral value not greater than x. RETURN VALUES
Upon successful completion, these functions return the largest integral value not greater than x, expressed as a double, float, or long double, as appropriate for the return type of the function. If x is NaN, a NaN is returned. If x is +-Inf or +-0, x is returned. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
ceil(3M), feclearexcept(3M), fetestexcept(3M), isnan(3M), math.h(3HEAD), attributes(5), standards(5) SunOS 5.10 1 Sep 2002 floor(3M)
Man Page

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting


Hello Experts, Is there any inbuild FLOOR function to do FLOOR func in mathmetics in awk script like in FlOOR Func in C. Ex:- floor(2.9) = 2 floor(2.1) = 2 floor(2.0) = 2 floor(-2.0) = 2 floor(-2.1) = -3 floor(-2.9) =... (1 Reply)
Discussion started by: user_prady
1 Replies

2. Shell Programming and Scripting

CEILING and FLOOR functions

Hi all, Does anyone know how to simulate a ceiling or floor function in UNIX? OS is Solaris. I tried the suggestion from an old forum but it is giving me error as below: server01/tmp$: echo "7.2" | awk '{printf("%d\n",$0+=$0<0?0:0.999)}' awk: syntax error near line 1 awk: illegal... (3 Replies)
Discussion started by: newbie_01
3 Replies

3. Programming

Round floor behavior

Hello, My round and floor functions in C program behaves weird. Can someone help resolve the issue.. fprintf( fp, "ROUND TEST VARIABLE 11686776.000000 %d\n", round(11686776.000000)); fprintf( fp, "ROUND TEST VARIABLE 1168677.000000 %d\n", round(1168677.000000)); fprintf( fp, "FLOOR... (3 Replies)
Discussion started by: anijan
3 Replies