Class Number
A simple class for number conversions.
Inheritance
System.Object
Number
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Lucene.Net.dll
Syntax
public static class Number
Fields
|
Improve this Doc
View Source
MAX_RADIX
Declaration
public const int MAX_RADIX = 36
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
MIN_RADIX
Declaration
public const int MIN_RADIX = 2
Field Value
Type |
Description |
System.Int32 |
|
Methods
|
Improve this Doc
View Source
BitCount(Int32)
Declaration
public static int BitCount(int num)
Parameters
Type |
Name |
Description |
System.Int32 |
num |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
BitCount(Int64)
Declaration
public static int BitCount(long num)
Parameters
Type |
Name |
Description |
System.Int64 |
num |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
DoubleToInt64Bits(Double)
NOTE: This was doubleToLongBits() in the JDK
Declaration
public static long DoubleToInt64Bits(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
DoubleToRawInt64Bits(Double)
NOTE: This was doubleToRawLongBits() in the JDK
Declaration
public static long DoubleToRawInt64Bits(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
FlipEndian(Char)
Declaration
public static char FlipEndian(char x)
Parameters
Type |
Name |
Description |
System.Char |
x |
|
Returns
Type |
Description |
System.Char |
|
|
Improve this Doc
View Source
FlipEndian(Double)
Declaration
public static double FlipEndian(double d)
Parameters
Type |
Name |
Description |
System.Double |
d |
|
Returns
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
FlipEndian(Int16)
Declaration
public static short FlipEndian(short x)
Parameters
Type |
Name |
Description |
System.Int16 |
x |
|
Returns
Type |
Description |
System.Int16 |
|
|
Improve this Doc
View Source
FlipEndian(Int32)
Declaration
public static int FlipEndian(int x)
Parameters
Type |
Name |
Description |
System.Int32 |
x |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
FlipEndian(Int64)
Declaration
public static long FlipEndian(long x)
Parameters
Type |
Name |
Description |
System.Int64 |
x |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
FlipEndian(Single)
Declaration
public static float FlipEndian(float f)
Parameters
Type |
Name |
Description |
System.Single |
f |
|
Returns
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
Int32BitsToSingle(Int32)
NOTE: This was intBitsToFloat() in the JDK
Declaration
public static float Int32BitsToSingle(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
|
Returns
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
IsNumber(Object)
Declaration
public static bool IsNumber(this object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
NumberOfLeadingZeros(Int32)
Declaration
public static int NumberOfLeadingZeros(int num)
Parameters
Type |
Name |
Description |
System.Int32 |
num |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
NumberOfLeadingZeros(Int64)
Declaration
public static int NumberOfLeadingZeros(long num)
Parameters
Type |
Name |
Description |
System.Int64 |
num |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
NumberOfTrailingZeros(Int32)
Declaration
public static int NumberOfTrailingZeros(int num)
Parameters
Type |
Name |
Description |
System.Int32 |
num |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
NumberOfTrailingZeros(Int64)
Declaration
public static int NumberOfTrailingZeros(long num)
Parameters
Type |
Name |
Description |
System.Int64 |
num |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Parse(String, Int32)
Parses a number in the specified radix.
Declaration
public static long Parse(string s, int radix)
Parameters
Type |
Name |
Description |
System.String |
s |
An input System.String.
|
System.Int32 |
radix |
A radix.
|
Returns
Type |
Description |
System.Int64 |
The parsed number in the specified radix.
|
|
Improve this Doc
View Source
RotateLeft(Int32, Int32)
Declaration
public static int RotateLeft(int i, int reps)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
System.Int32 |
reps |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
RotateRight(Int32, Int32)
Declaration
public static int RotateRight(int i, int reps)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
System.Int32 |
reps |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Signum(Int64)
Declaration
public static int Signum(long a)
Parameters
Type |
Name |
Description |
System.Int64 |
a |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
SingleToInt32Bits(Single)
NOTE: This was floatToIntBits() in the JDK
Declaration
public static int SingleToInt32Bits(float value)
Parameters
Type |
Name |
Description |
System.Single |
value |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
SingleToInt64Bits(Single)
NOTE: This was floatToLongBits() in the JDK
Declaration
public static long SingleToInt64Bits(float value)
Parameters
Type |
Name |
Description |
System.Single |
value |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
SingleToRawInt32Bits(Single)
NOTE: This was floatToRawIntBits() in the JDK
Declaration
public static int SingleToRawInt32Bits(float value)
Parameters
Type |
Name |
Description |
System.Single |
value |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
ToBinaryString(Int32)
Declaration
public static string ToBinaryString(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
ToInt64(String)
Converts a System.String number to long.
Declaration
public static long ToInt64(string s)
Parameters
Type |
Name |
Description |
System.String |
s |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
ToString(Int64)
Converts a number to System.String.
Declaration
public static string ToString(long number)
Parameters
Type |
Name |
Description |
System.Int64 |
number |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
ToString(Int64, Int32)
Converts a number to System.String in the specified radix.
Declaration
public static string ToString(long i, int radix)
Parameters
Type |
Name |
Description |
System.Int64 |
i |
A number to be converted.
|
System.Int32 |
radix |
A radix.
|
Returns
Type |
Description |
System.String |
A System.String representation of the number in the specified redix.
|
|
Improve this Doc
View Source
ToString(Single)
Converts a number to System.String.
Declaration
public static string ToString(float f)
Parameters
Type |
Name |
Description |
System.Single |
f |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
URShift(Int32, Int32)
Performs an unsigned bitwise right shift with the specified number
Declaration
public static int URShift(int number, int bits)
Parameters
Type |
Name |
Description |
System.Int32 |
number |
Number to operate on
|
System.Int32 |
bits |
Ammount of bits to shift
|
Returns
Type |
Description |
System.Int32 |
The resulting number from the shift operation
|
|
Improve this Doc
View Source
URShift(Int64, Int32)
Performs an unsigned bitwise right shift with the specified number
Declaration
public static long URShift(long number, int bits)
Parameters
Type |
Name |
Description |
System.Int64 |
number |
Number to operate on
|
System.Int32 |
bits |
Ammount of bits to shift
|
Returns
Type |
Description |
System.Int64 |
The resulting number from the shift operation
|