Class BinaryPrefix
Defines a binary unit prefix for multiples of measurement for data that refers strictly to powers of 2. This class cannot be inherited.
public sealed class BinaryPrefix : Prefix, IPrefix
- Inheritance
-
BinaryPrefix
- Implements
- Inherited Members
- Extension Methods
Constructors
BinaryPrefix(string, string, double)
Initializes a new instance of the BinaryPrefix class.
public BinaryPrefix(string name, string symbol, double exponent)
Parameters
namestringThe name of the binary prefix.
symbolstringThe symbol of the binary prefix.
exponentdoubleThe number that specifies a power.
Fields
BitsPerByte
Defines how many bits is needed for one byte.
public const int BitsPerByte = 8
Field Value
BitsPerNibble
Defines how many bits is needed for one nibble (one hexadecimal digit).
public const int BitsPerNibble = 4
Field Value
Properties
BinaryPrefixes
Gets the complete sequence of multiples binary prefixes as specified by Institute of Electrical and Electronics Engineers (IEEE).
public static IEnumerable<BinaryPrefix> BinaryPrefixes { get; }
Property Value
- IEnumerable<BinaryPrefix>
The complete sequence of multiples binary prefixes as specified by Institute of Electrical and Electronics Engineers (IEEE).
Exbi
Gets the binary-multiple prefix exbi (symbol 'Ei'), 2^60 = 1152921504606846976.
public static BinaryPrefix Exbi { get; }
Property Value
- BinaryPrefix
The binary-multiple prefix exbi (symbol 'Ei').
Gibi
Gets the binary-multiple prefix gibi (symbol 'Gi'), 2^30 = 1073741824.
public static BinaryPrefix Gibi { get; }
Property Value
- BinaryPrefix
The binary-multiple prefix gibi (symbol 'Gi').
Kibi
Gets the binary-multiple prefix kibi (symbol 'Ki'), 2^10 = 1024.
public static BinaryPrefix Kibi { get; }
Property Value
- BinaryPrefix
The binary-multiple prefix kibi (symbol 'Ki').
Mebi
Gets the binary-multiple prefix mebi (symbol 'Mi'), 2^20 = 1048576.
public static BinaryPrefix Mebi { get; }
Property Value
- BinaryPrefix
The binary-multiple prefix mebi (symbol 'Mi').
Pebi
Gets the binary-multiple prefix pebi (symbol 'Pi'), 2^50 = 1125899906842624.
public static BinaryPrefix Pebi { get; }
Property Value
- BinaryPrefix
The binary-multiple prefix pebi (symbol 'Pi').
Tebi
Gets the binary-multiple prefix tebi (symbol 'Ti'), 2^40 = 1099511627776.
public static BinaryPrefix Tebi { get; }
Property Value
- BinaryPrefix
The binary-multiple prefix tebi (symbol 'Ti').
Yobi
Gets the binary-multiple prefix yobi (symbol 'Yi'), 2^80 = 1208925819614629174706176.
public static BinaryPrefix Yobi { get; }
Property Value
- BinaryPrefix
The binary-multiple prefix yobi (symbol 'Yi').
Zebi
Gets the binary-multiple prefix zebi (symbol 'Zi'), 2^70 = 1180591620717411303424.
public static BinaryPrefix Zebi { get; }
Property Value
- BinaryPrefix
The binary-multiple prefix zebi (symbol 'Zi').
Methods
ConvertBitsToBytes(double)
Converts a value in bits to bytes.
public static double ConvertBitsToBytes(double bits)
Parameters
bitsdoubleThe value in bits to convert.
Returns
- double
The equivalent value in bytes.
ConvertBytesToBits(double)
Converts a value in bytes to bits.
public static double ConvertBytesToBits(double bytes)
Parameters
bytesdoubleThe value in bytes to convert.
Returns
- double
The equivalent value in bits.
Exceptions
- ArgumentOutOfRangeException
bytesis less than 0.