C# Class Spring.Util.NumberUtils

Various utility methods relating to numbers.

Mainly for internal use within the framework.

Afficher le fichier Open project: spring-projects/spring-net Class Usage Examples

Méthodes publiques

Méthode Description
Add ( object m, object n ) : object

Adds the specified numbers.

BitwiseAnd ( object m, object n ) : object

Bitwise ANDs (&) the specified integral values.

BitwiseNot ( object number ) : object

Returns the bitwise not (~) of the supplied number.

BitwiseOr ( object m, object n ) : object

Bitwise ORs (|) the specified integral values.

BitwiseXor ( object m, object n ) : object

Bitwise XORs (^) the specified integral values.

CanConvertToDecimal ( object number ) : bool

Determines whether the supplied number can be converted to an integer.

CanConvertToInteger ( object number ) : bool

Determines whether the supplied number can be converted to an integer.

CanConvertToNumber ( object number ) : bool

Determines whether the supplied number can be converted to a number.

CoerceTypes ( object &m, object &n ) : void

Coerces the types so they can be compared.

Divide ( object m, object n ) : object

Divides the specified numbers.

IsDecimal ( object number ) : bool

Determines whether the supplied number is a decimal number.

IsInteger ( object number ) : bool

Determines whether the supplied number is an integer.

IsNumber ( object number ) : bool

Determines whether the supplied number is of numeric type.

IsZero ( object number ) : bool

Is the supplied number equal to zero (0)?

Modulus ( object m, object n ) : object

Calculates remainder for the specified numbers.

Multiply ( object m, object n ) : object

Multiplies the specified numbers.

Negate ( object number ) : object

Negates the supplied number.

Power ( object m, object n ) : object

Raises first number to the power of the second one.

Subtract ( object m, object n ) : object

Subtracts the specified numbers.

Private Methods

Méthode Description
NumberUtils ( ) : System

Creates a new instance of the Spring.Util.NumberUtils class.

This is a utility class, and as such exposes no public constructors.

Method Details

Add() public static méthode

Adds the specified numbers.
public static Add ( object m, object n ) : object
m object The first number.
n object The second number.
Résultat object

BitwiseAnd() public static méthode

Bitwise ANDs (&) the specified integral values.
/// If one of the supplied arguments is not a supported integral types. ///
public static BitwiseAnd ( object m, object n ) : object
m object The first number.
n object The second number.
Résultat object

BitwiseNot() public static méthode

Returns the bitwise not (~) of the supplied number.
/// If the supplied is not a supported numeric type. ///
public static BitwiseNot ( object number ) : object
number object The number.
Résultat object

BitwiseOr() public static méthode

Bitwise ORs (|) the specified integral values.
/// If one of the supplied arguments is not a supported integral types. ///
public static BitwiseOr ( object m, object n ) : object
m object The first number.
n object The second number.
Résultat object

BitwiseXor() public static méthode

Bitwise XORs (^) the specified integral values.
/// If one of the supplied arguments is not a supported integral types. ///
public static BitwiseXor ( object m, object n ) : object
m object The first number.
n object The second number.
Résultat object

CanConvertToDecimal() public static méthode

Determines whether the supplied number can be converted to an integer.
public static CanConvertToDecimal ( object number ) : bool
number object The object to check.
Résultat bool

CanConvertToInteger() public static méthode

Determines whether the supplied number can be converted to an integer.
public static CanConvertToInteger ( object number ) : bool
number object The object to check.
Résultat bool

CanConvertToNumber() public static méthode

Determines whether the supplied number can be converted to a number.
public static CanConvertToNumber ( object number ) : bool
number object The object to check.
Résultat bool

CoerceTypes() public static méthode

Coerces the types so they can be compared.
public static CoerceTypes ( object &m, object &n ) : void
m object The right.
n object The left.
Résultat void

Divide() public static méthode

Divides the specified numbers.
public static Divide ( object m, object n ) : object
m object The first number.
n object The second number.
Résultat object

IsDecimal() public static méthode

Determines whether the supplied number is a decimal number.
public static IsDecimal ( object number ) : bool
number object The object to check.
Résultat bool

IsInteger() public static méthode

Determines whether the supplied number is an integer.
public static IsInteger ( object number ) : bool
number object The object to check.
Résultat bool

IsNumber() public static méthode

Determines whether the supplied number is of numeric type.
public static IsNumber ( object number ) : bool
number object The object to check.
Résultat bool

IsZero() public static méthode

Is the supplied number equal to zero (0)?
public static IsZero ( object number ) : bool
number object The number to check.
Résultat bool

Modulus() public static méthode

Calculates remainder for the specified numbers.
public static Modulus ( object m, object n ) : object
m object The first number (dividend).
n object The second number (divisor).
Résultat object

Multiply() public static méthode

Multiplies the specified numbers.
public static Multiply ( object m, object n ) : object
m object The first number.
n object The second number.
Résultat object

Negate() public static méthode

Negates the supplied number.
/// If the supplied is not a supported numeric type. ///
public static Negate ( object number ) : object
number object The number to negate.
Résultat object

Power() public static méthode

Raises first number to the power of the second one.
public static Power ( object m, object n ) : object
m object The first number.
n object The second number.
Résultat object

Subtract() public static méthode

Subtracts the specified numbers.
public static Subtract ( object m, object n ) : object
m object The first number.
n object The second number.
Résultat object