[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


floor

Compute the largest floating point not greater than x.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <math.h>

double floor(double x);
float floorf(float);
long double floorl(long double);
Parameters:

Parameters for this function are:

x  
float, double or long double  
value to be computed  

Return:

floor() returns the largest integer not greater than x.

See Also:

"ceil"

"fmod"

"fabs"

floor() example:
#include <math.h>
#include <stdio.h>

int main(void)
{
	double x = 12.03, y = 10.999;

	printf("Floor value of %f is %f.\n", x, floor(x));
	printf("Floor value of %f is %f.\n", y, floor(y));

	return 0;
}

Output:
Floor value of 12.030000 is 12.000000.
Floor value of 10.999000 is 10.000000.


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000