Microsoft Binary Format
In computing, Microsoft Binary Format (MBF) was a format for floating point numbers used in Microsoft's BASIC language products including MBASIC, QuickBasic and GW-BASIC.[1]
MBF numbers consist of a sign bit, an eight bit exponent with bias 128, and a 23 or 55 bit significand. The decimal point is located before the assumed bit. The MBF double precision format provided slightly more precison than the IEEE 754 format, but less scale.[2][3]
MBF single-precision format (32 bits):
Exponent | Sign | Significand |
---|---|---|
8 bits, bit 31-24 | 1 bit, bit 23 | 23 bits, bit 22-0 |
xxxxxxxx | s | mmmmmmmmmmmmmmmmmmmmmmm |
MBF double-precision format (64 bits):
Exponent | Sign | Significand |
---|---|---|
8 bits, bit 63-56 | 1 bit, bit 55 | 55 bits, bit 54-0 |
xxxxxxxx | s | mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm |
By the time Visual Basic was released, the IEEE 754 standard had become widely adopted - for example, it was incorporated into Intel's 387 coprocessor and every x86 processor from the 486 on. Visual Basic uses the IEEE 754 format instead of MBF.
See also
- Floating point
- IEEE 754 — Standard for Binary Floating-Point Arithmetic
- IBM Floating Point Architecture
Further reading
- Microsoft provides a 16 bit dynamic link library with C source code containing functions to convert MBF data to IEEE 754.
- MBF to IEEE function written in Python
- MBF to IEEE conversion functions in C/C++ borrowed from old Microsoft supported code. (Pay to view)
Notes and references
- ↑ "IEEE vs. Microsoft Binary Format; Rounding Issues (Complete)". Microsoft Support. November 21, 2006. Retrieved February 24, 2010.
- ↑ "IEEE vs. Microsoft Binary Format; Rounding Issues (Complete)". Microsoft Support. November 21, 2006. Retrieved February 24, 2010.
- ↑ "Need to access MBF (Microsoft Binary Format) data". Experts Exchange. December 11, 2001. Retrieved February 24, 2010.(subscription required)