BiffRk Class
Definition
Encodes and decodes the RK number representation: a 32-bit value whose two low bits select between a signed 30-bit integer and the high 30 bits of an IEEE 754 double, optionally divided by 100.
public static class BiffRk
- Inheritance
-
BiffRk
- Inherited Members
Remarks
Bit 0 set means the decoded value is divided by 100; bit 1 set means the high 30 bits are a signed integer, clear
means they are the most significant 30 bits of a double whose remaining 34 bits are zero. Not every double has an RK
form - TryEncode(double, out uint) reports when a value must be written as a NUMBER record instead.
Methods
Decode(uint)
Decodes an RK value.
public static double Decode(uint rk)
Parameters
rkuintThe 32-bit RK value.
Returns
- double
The number the value represents.
TryEncode(double, out uint)
Attempts to encode a number in RK form, preferring the plain integer and truncated-double forms and falling back to their divided-by-100 variants when those represent the value exactly.
public static bool TryEncode(double value, out uint rk)
Parameters
valuedoubleThe number to encode.
rkuintWhen this method returns, the RK value when one represents
valueexactly.
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |