Keil Logo

floor

Summary
#include <math.h>

double floor (
  double val);   /* number to calculate floor for */
Description

The floor function calculates the largest integer value that is less than or equal to val.

Return Value

The floor function returns a float that contains the largest integer value that is not greater than val.

See Also

ceil

Example
#include <math.h>
#include <stdio.h> /* for printf */

void tst_floor (void) {
  float x;
  float y;

  x = 45.998;
  y = floor (x);

  printf ("FLOOR(%f) = %f\n", x, y);   /* prints 45 */
}
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.