Int
|
[SerializableAttribute] public struct Int24 : IComparable, IFormattable, IConvertible, IComparable<Int24>, IComparable<int>, IEquatable<Int24>, IEquatable<int>
The Int24 type exposes the following members.
Name | Description | |
---|---|---|
Int24(Int24) | Creates 24-bit signed integer from an existing 24-bit signed integer. | |
Int24(Int32) | Creates 24-bit signed integer from a 32-bit signed integer. | |
Int24(Byte, Int32) | Creates 24-bit signed integer from three bytes at a specified position in a byte array. |
Name | Description | |
---|---|---|
CompareTo(Int24) | Compares this instance to a specified 24-bit signed integer and returns an indication of their relative values. | |
CompareTo(Int32) | Compares this instance to a specified 32-bit signed integer and returns an indication of their relative values. | |
CompareTo(Object) | Compares this instance to a specified object and returns an indication of their relative values. | |
Equals(Int24) | Returns a value indicating whether this instance is equal to a specified Int24 value. | |
Equals(Int32) | Returns a value indicating whether this instance is equal to a specified Int32 value. | |
Equals(Object) |
Returns a value indicating whether this instance is equal to a specified object.
(Overrides ValueTypeEquals(Object)) | |
GetBytes | Returns the Int24 value as an array of three bytes. | |
GetBytes(Int24) | Returns the specified Int24 value as an array of three bytes. | |
GetHashCode |
Returns the hash code for this instance.
(Overrides ValueTypeGetHashCode) | |
GetType | Gets the Type of the current instance. (Inherited from Object) | |
GetTypeCode | Returns the System.TypeCode for value type System.Int32 (there is no defined type code for an Int24). | |
GetValue | Returns a 24-bit signed integer from three bytes at a specified position in a byte array. | |
Parse(String) | Converts the string representation of a number to its 24-bit signed integer equivalent. | |
Parse(String, NumberStyles) | Converts the string representation of a number in a specified style to its 24-bit signed integer equivalent. | |
Parse(String, IFormatProvider) | Converts the string representation of a number in a specified culture-specific format to its 24-bit signed integer equivalent. | |
Parse(String, NumberStyles, IFormatProvider) | Converts the string representation of a number in a specified style and culture-specific format to its 24-bit signed integer equivalent. | |
ToString |
Converts the numeric value of this instance to its equivalent string representation.
(Overrides ValueTypeToString) | |
ToString(IFormatProvider) | Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. | |
ToString(String) | Converts the numeric value of this instance to its equivalent string representation, using the specified format. | |
ToString(String, IFormatProvider) | Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. | |
TryParse(String, Int24) | Converts the string representation of a number to its 24-bit signed integer equivalent. A return value indicates whether the conversion succeeded or failed. | |
TryParse(String, NumberStyles, IFormatProvider, Int24) | Converts the string representation of a number in a specified style and culture-specific format to its 24-bit signed integer equivalent. A return value indicates whether the conversion succeeded or failed. |
Name | Description | |
---|---|---|
Addition(Int24, Int24) | Returns computed sum of values. | |
Addition(Int24, Int32) | Returns computed sum of values. | |
Addition(Int32, Int24) | Returns computed sum of values. | |
BitwiseAnd(Int24, Int24) | Returns logical bitwise AND of values. | |
BitwiseAnd(Int24, Int32) | Returns logical bitwise AND of values. | |
BitwiseAnd(Int32, Int24) | Returns logical bitwise AND of values. | |
BitwiseOr(Int24, Int24) | Returns logical bitwise OR of values. | |
BitwiseOr(Int24, Int32) | Returns logical bitwise OR of values. | |
BitwiseOr(Int32, Int24) | Returns logical bitwise OR of values. | |
Decrement(Int24) | Returns decremented value. | |
Division(Int24, Int24) | Returns computed division of values. | |
Division(Int24, Int32) | Returns computed division of values. | |
Division(Int32, Int24) | Returns computed division of values. | |
Equality(Int24, Int24) | Compares the two values for equality. | |
Equality(Int24, Int32) | Compares the two values for equality. | |
Equality(Int32, Int24) | Compares the two values for equality. | |
ExclusiveOr(Int24, Int24) | Returns logical bitwise exclusive-OR of values. | |
ExclusiveOr(Int24, Int32) | Returns logical bitwise exclusive-OR of values. | |
ExclusiveOr(Int32, Int24) | Returns logical bitwise exclusive-OR of values. | |
(Decimal to Int24) | Explicitly converts value to an Int24. | |
(Double to Int24) | Explicitly converts value to an Int24. | |
(Enum to Int24) | Explicitly converts value to an Int24. | |
(Int24 to Byte) | Explicitly converts Int24 to Byte. | |
(Int24 to Int16) | Explicitly converts Int24 to Int16. | |
(Int24 to UInt16) | Explicitly converts Int24 to UInt16. | |
(Int32 to Int24) | Explicitly converts value to an Int24. | |
(Int64 to Int24) | Explicitly converts value to an Int24. | |
(Single to Int24) | Explicitly converts value to an Int24. | |
(String to Int24) | Explicitly converts value to an Int24. | |
Exponent(Int24, Int24) | Returns result of first value raised to power of second value. | |
Exponent(Int24, Int32) | Returns result of first value raised to power of second value. | |
Exponent(Int32, Int24) | Returns result of first value raised to power of second value. | |
False(Int24) | Returns true if value is equal to zero. | |
GreaterThan(Int24, Int24) | Returns true if left value is greater than right value. | |
GreaterThan(Int24, Int32) | Returns true if left value is greater than right value. | |
GreaterThan(Int32, Int24) | Returns true if left value is greater than right value. | |
GreaterThanOrEqual(Int24, Int24) | Returns true if left value is greater than or equal to right value. | |
GreaterThanOrEqual(Int24, Int32) | Returns true if left value is greater than or equal to right value. | |
GreaterThanOrEqual(Int32, Int24) | Returns true if left value is greater than or equal to right value. | |
(Byte to Int24) | Implicitly converts value to an Int24. | |
(Char to Int24) | Implicitly converts value to an Int24. | |
(Int16 to Int24) | Implicitly converts value to an Int24. | |
(Int24 to Decimal) | Implicitly converts Int24 to Decimal. | |
(Int24 to Double) | Implicitly converts Int24 to Double. | |
(Int24 to Int32) | Implicitly converts Int24 to Int32. | |
(Int24 to Int64) | Implicitly converts Int24 to Int64. | |
(Int24 to Single) | Implicitly converts Int24 to Single. | |
(Int24 to String) | Implicitly converts Int24 to String. | |
(Int24 to UInt32) | Implicitly converts Int24 to UInt32. | |
(Int24 to UInt64) | Implicitly converts Int24 to UInt64. | |
Increment(Int24) | Returns incremented value. | |
Inequality(Int24, Int24) | Compares the two values for inequality. | |
Inequality(Int24, Int32) | Compares the two values for inequality. | |
Inequality(Int32, Int24) | Compares the two values for inequality. | |
LeftShift(Int24, Int32) | Returns value after left shifts of first value by the number of bits specified by second value. | |
LessThan(Int24, Int24) | Returns true if left value is less than right value. | |
LessThan(Int24, Int32) | Returns true if left value is less than right value. | |
LessThan(Int32, Int24) | Returns true if left value is less than right value. | |
LessThanOrEqual(Int24, Int24) | Returns true if left value is less or equal to than right value. | |
LessThanOrEqual(Int24, Int32) | Returns true if left value is less or equal to than right value. | |
LessThanOrEqual(Int32, Int24) | Returns true if left value is less or equal to than right value. | |
Modulus(Int24, Int24) | Returns computed remainder after dividing first value by the second. | |
Modulus(Int24, Int32) | Returns computed remainder after dividing first value by the second. | |
Modulus(Int32, Int24) | Returns computed remainder after dividing first value by the second. | |
Multiply(Int24, Int24) | Returns computed product of values. | |
Multiply(Int24, Int32) | Returns computed product of values. | |
Multiply(Int32, Int24) | Returns computed product of values. | |
OnesComplement(Int24) | Returns bitwise complement of value. | |
RightShift(Int24, Int32) | Returns value after right shifts of first value by the number of bits specified by second value. | |
Subtraction(Int24, Int24) | Returns computed difference of values. | |
Subtraction(Int24, Int32) | Returns computed difference of values. | |
Subtraction(Int32, Int24) | Returns computed difference of values. | |
True(Int24) | Returns true if value is not zero. |
Name | Description | |
---|---|---|
BitMask | High byte bit-mask used when a 24-bit integer is stored within a 32-bit integer. This field is constant. | |
MaxValue | Represents the largest possible value of an Int24. This field is constant. | |
MinValue | Represents the smallest possible value of an Int24. This field is constant. |
Name | Description | |
---|---|---|
BitRotL |
Performs rightwise bit-rotation for the specified number of rotations.
(Defined by BitExtensions) | |
BitRotR |
Performs rightwise bit-rotation for the specified number of rotations.
(Defined by BitExtensions) | |
CheckBits |
Determines if specified bits are set.
(Defined by BitExtensions) | |
CheckBits |
Determines if specified bits are set.
(Defined by BitExtensions) | |
CheckBits |
Determines if specified bits are set.
(Defined by BitExtensions) | |
CheckBits |
Determines if specified bits are set.
(Defined by BitExtensions) | |
ClearBits |
Returns value with specified bits cleared.
(Defined by BitExtensions) | |
ClearBits |
Returns value with specified bits cleared.
(Defined by BitExtensions) | |
GetEnumValueOrDefault |
Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions) | |
GetEnumValueOrDefaultT |
Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions) | |
GetMaskedValue |
Returns value stored in the bits represented by the specified bitmask.
(Defined by BitExtensions) | |
GetMaskedValue |
Returns value stored in the bits represented by the specified bitmask.
(Defined by BitExtensions) | |
SetBits |
Returns value with specified bits set.
(Defined by BitExtensions) | |
SetBits |
Returns value with specified bits set.
(Defined by BitExtensions) | |
SetMaskedValue |
Returns value after setting a new value for the bits specified by the bitmask.
(Defined by BitExtensions) | |
SetMaskedValue |
Returns value after setting a new value for the bits specified by the bitmask.
(Defined by BitExtensions) | |
ToBinaryString |
Encodes value as binary, i.e., a string of bit values (0 or 1).
(Defined by BitExtensions) | |
ToggleBits |
Returns value with specified bits toggled.
(Defined by BitExtensions) | |
ToggleBits |
Returns value with specified bits toggled.
(Defined by BitExtensions) |
This class behaves like most other intrinsic signed integers but allows a 3-byte, 24-bit integer implementation that is often found in many digital-signal processing arenas and different kinds of protocol parsing. A signed 24-bit integer is typically used to save storage space on disk where its value range of -8388608 to 8388607 is sufficient, but the signed Int16 value range of -32768 to 32767 is too small.
This structure uses an Int32 internally for storage and most other common expected integer functionality, so using a 24-bit integer will not save memory. However, if the 24-bit signed integer range (-8388608 to 8388607) suits your data needs you can save disk space by only storing the three bytes that this integer actually consumes. You can do this by calling the Int24.GetBytes function to return a three byte binary array that can be serialized to the desired destination and then calling the Int24.GetValue function to restore the Int24 value from those three bytes.
All the standard operators for the Int24 have been fully defined for use with both Int24 and Int32 signed integers; you should find that without the exception Int24 can be compared and numerically calculated with an Int24 or Int32. Necessary casting should be minimal and typical use should be very simple - just as if you are using any other native signed integer.