page_title: Microsoft Binary Format
section_title: IEEE 754
hierarchical_section_title: Microsoft Binary Format / History / IEEE 754
context_page_description: In computing, Microsoft Binary Format is a format for floating-point numbers which was used in Microsoft's BASIC language products, including MBASIC, GW-BASIC and QuickBASIC prior to version 4.00.
  There are two main versions of the format. The original version was designed for memory-constrained systems and stored numbers in 32 bits, with a 23-bit mantissa, 1-bit sign, and an 8-bit exponent. Extended BASIC included a double-precision type with 64 bits.
  During the period when it was being ported from the Intel 8080 platform to the MOS 6502 processor, computers were beginning to ship with more memory as a standard feature. This version was offered with the original 32-bit format or an optional expanded 40-bit format. The 40-bit format was used by most home computers of the 1970s and 1980s. These two versions are sometimes known as "6-digit" and "9-digit", respectively.
  On PCs with x86 processor, QuickBASIC, prior to version 4, reintroduced the double-precision format using a 55-bit mantissa in a 64-bit format. MBF was abandoned during the move to QuickBASIC 4, which used the standard IEEE 754 format, introduced a few years earlier.
context_section_description: As early as in 1976, Intel was starting the development of a floating-point coprocessor. Intel hoped to be able to sell a chip containing good implementations of all the operations found in the widely varying maths software libraries.
  John Palmer, who managed the project, contacted William Kahan of the University of California, who suggested that Intel use the floating point of Digital Equipment Corporation's (DEC) VAX. The first VAX, the VAX-11/780 had just come out in late 1977, and its floating point was highly regarded. However, seeking to market their chip to the broadest possible market, Intel wanted the best floating point possible, and Kahan went on to draw up specifications.
  When rumours of Intel's new chip reached its competitors, they started a standardization effort, called IEEE 754, to prevent Intel from gaining too much ground. Kahan got Palmer's permission to participate; he was allowed to explain Intel's design decisions and their underlying reasoning, but not anything related to Intel's implementation architecture. VAX's floating-point formats differed from MBF only in that it had the sign in the most significant bit.
  It turned out that an 8-bit exponent was not wide enough for some operations desired for double-precision numbers, e.g. to store the product of two 32-bit numbers. Both Kahan's proposal and a counter-proposal by DEC therefore used 11 bits, like the time-tested 60-bit floating-point format of the CDC 6600 from 1965. Kahan's proposal also provided for infinities, which are useful when dealing with division-by-zero conditions; not-a-number values, which are useful when dealing with invalid operations; denormal numbers, which help mitigate problems caused by underflow; and a better balanced exponent bias, which can help avoid overflow and underflow when taking the reciprocal of a number.
  In 1980, the Intel 8087 chip was already released, but DEC remained opposed, to denormal numbers in particular, because of performance concerns and since it would give DEC a competitive advantage to standardise on DEC's format. The next year, DEC had a study done in order to demonstrate that gradual underflow was a bad idea, but the study concluded the opposite, and DEC gave in. In 1985, the standard was ratified, but it had already become the de facto standard a year earlier, implemented by many manufacturers.
  By the time QuickBASIC 4.00 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.  QuickBASIC versions 4.0 and 4.5 use IEEE 754 floating-point variables by default, but (at least in version 4.5) there is a command-line option /MBF for the IDE and the compiler that switches from IEEE to MBF floating-point numbers, to support earlier-written programs that rely on details of the MBF data formats.  Visual Basic also uses the IEEE 754 format instead of MBF.
caption: Intel 8087 floating-point coprocessor
exif: {}