C# Class GameMath.Round

Show file Open project: npruehs/game-math

Public Methods

Method Description
Ceil ( double x ) : int

Returns the smallest integer greater than or equal to the specified number.

Floor ( double x ) : int

Returns the largest integer less than or equal to the specified number.

Nearest ( double x ) : int

Rounds the specified number to the nearest integer.

Truncate ( double x ) : int

Returns the integral part of the specified number.

Method Details

Ceil() public static method

Returns the smallest integer greater than or equal to the specified number.
public static Ceil ( double x ) : int
x double /// Number to ceil. ///
return int

Floor() public static method

Returns the largest integer less than or equal to the specified number.
public static Floor ( double x ) : int
x double /// Number to floor. ///
return int

Nearest() public static method

Rounds the specified number to the nearest integer.
public static Nearest ( double x ) : int
x double /// Number to round. ///
return int

Truncate() public static method

Returns the integral part of the specified number.
public static Truncate ( double x ) : int
x double /// Number to truncate. ///
return int