Table of Contents

BiffRk Class

Definition

Namespace
Bodu.IO.Biff
Assembly
Bodu.IO.Biff.dll
Package
Bodu.IO.Biff 1.0.0
Source
BiffRk.cs

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

rk uint

The 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

value double

The number to encode.

rk uint

When this method returns, the RK value when one represents value exactly.

Returns

bool

true when value has an exact RK form; otherwise false, in which case the value must be written as a NUMBER record.

Applies to

ProductVersions
.NET8, 10