floor

Summary

Rounds a number down.

Usage

public static double floor(double x)

Returns

The result of rounding down the number.

Parameters

x

The number to round down.

Description

Rounds a number down. (Returns the floor of a number.)

Examples

Basic Usage
1
2
3
4
5
6
import System;
 
Console.log(Math.floor(1));    // 1
Console.log(Math.floor(2.5));  // 2
Console.log(Math.floor(2.01)); // 2
Console.log(Math.floor(2.9));  // 2

Share

HTML | BBCode | Direct Link