CARM User's Guide

Discontinued

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 */
}