Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Index based on a float-field

Status
Not open for further replies.

Tamina

Programmer
Oct 3, 2000
21
HR
In my table, I have an index based on a float-field. How does Btrieve handle that? Is there some kind of algorythm how to transform 8-byte number into a string representing the appropriate key-value? It would be very useful, so if anyone knows please let me know.
 
From the Btrieve documentation:
The FLOAT key type is consistent with the IEEE standard for single and double-precision real numbers. The internal format for a 4-byte FLOAT consists of a 23-bit mantissa, an 8-bit exponent biased by 127, and a sign bit. A FLOAT key with 8 bytes has a 52-bit mantissa, an 11-bit exponent biased by 1023, and a sign bit.

What does this mean? Btrieve stores the Float as an IEEE number and sorts based on that information. It does not store it as a string for display or sorting. That's why if you use BUTIL to extract records, you won't see the float as a displayable number but as the binary bytes that make up the float. info@mirtheil.com
Custom VB and Btrieve development.
Certified Pervasive Developer
Certified Pervasive Technician
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top