C# Класс Spring.Util.NumberUtils

Various utility methods relating to numbers.

Mainly for internal use within the framework.

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
NumberUtils ( ) : System

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

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

Описание методов

Add() публичный статический Метод

Adds the specified numbers.
public static Add ( object m, object n ) : object
m object The first number.
n object The second number.
Результат object

BitwiseAnd() публичный статический Метод

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.
Результат object

BitwiseNot() публичный статический Метод

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.
Результат object

BitwiseOr() публичный статический Метод

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.
Результат object

BitwiseXor() публичный статический Метод

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.
Результат object

CanConvertToDecimal() публичный статический Метод

Determines whether the supplied number can be converted to an integer.
public static CanConvertToDecimal ( object number ) : bool
number object The object to check.
Результат bool

CanConvertToInteger() публичный статический Метод

Determines whether the supplied number can be converted to an integer.
public static CanConvertToInteger ( object number ) : bool
number object The object to check.
Результат bool

CanConvertToNumber() публичный статический Метод

Determines whether the supplied number can be converted to a number.
public static CanConvertToNumber ( object number ) : bool
number object The object to check.
Результат bool

CoerceTypes() публичный статический Метод

Coerces the types so they can be compared.
public static CoerceTypes ( object &m, object &n ) : void
m object The right.
n object The left.
Результат void

Divide() публичный статический Метод

Divides the specified numbers.
public static Divide ( object m, object n ) : object
m object The first number.
n object The second number.
Результат object

IsDecimal() публичный статический Метод

Determines whether the supplied number is a decimal number.
public static IsDecimal ( object number ) : bool
number object The object to check.
Результат bool

IsInteger() публичный статический Метод

Determines whether the supplied number is an integer.
public static IsInteger ( object number ) : bool
number object The object to check.
Результат bool

IsNumber() публичный статический Метод

Determines whether the supplied number is of numeric type.
public static IsNumber ( object number ) : bool
number object The object to check.
Результат bool

IsZero() публичный статический Метод

Is the supplied number equal to zero (0)?
public static IsZero ( object number ) : bool
number object The number to check.
Результат bool

Modulus() публичный статический Метод

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).
Результат object

Multiply() публичный статический Метод

Multiplies the specified numbers.
public static Multiply ( object m, object n ) : object
m object The first number.
n object The second number.
Результат object

Negate() публичный статический Метод

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.
Результат object

Power() публичный статический Метод

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.
Результат object

Subtract() публичный статический Метод

Subtracts the specified numbers.
public static Subtract ( object m, object n ) : object
m object The first number.
n object The second number.
Результат object