105 votes
Accepted

Why not use fractions instead of floating point?

When adding or subtracting fractions, you need to find the least common multiple of the two denominators. That's an expensive operation, much more expensive than adding or subtracting floating points, ...
user avatar
  • 20.9k
60 votes
Accepted

Where did the free parameters of IEEE 754 come from?

From an interview with Dr. William Kahan, the IEEE-754 formats were based on the VAX F and G formats, which have 8 and 11-bit exponents respectively. In fact Dr. Kahan also said that previously VAX ...
user avatar
  • 3,207
55 votes

What was the last x86 CPU that did not have the x87 floating-point unit built in?

As far as I’m aware, the last FPU-less x86-compatible CPU which could still be considered general-purpose is the Vortex86SX, released in 2007 and still available now. This is a Pentium-class CPU, ...
user avatar
54 votes

Why not use fractions instead of floating point?

My question is, why not use fractions? Quick answer: Too much code needed Dynamic storage needed Long representation even for simple numbers Complex and slow execution And most prominent: Because ...
user avatar
  • 166k
52 votes

Did any compiler fully use Intel x87 80-bit floating point?

TL:DR: Yes, most C/C++ compilers other than MSVC expose an 80-bit IEEE754 Extended Precision format (x87, 68881) as long double, and some implementations of other languages have it as REAL10 or ...
user avatar
  • 2,113
49 votes
Accepted

Did any compiler fully use Intel x87 80-bit floating point?

Yes. For example, the C math library has had full support for long double, which on x87 was 80 bits wide, since C99. Previous versions of the standard library supported only the double type. ...
user avatar
  • 5,690
48 votes
Accepted

How did the 8086 interface with the 8087 FPU coprocessor?

The opcodes in your list are all only 16 bits (plus the extra bytes for address calculation) and you'll notice that they all begin (in hex) with Dx where x >= 8. This is because, to the 8086, any ...
user avatar
  • 10.1k
46 votes
Accepted

Did any PC software floating point use non-IEEE format?

Turbo Pascal 2.x and the "ordinary" version of Turbo Pascal 3.x used a six-byte floating-point format which offered higher precision than an IEEE single-precision float, offering the ...
user avatar
  • 26.2k
43 votes
Accepted

Why did 8-bit Basic use 40-bit floating point?

The floating-point routines for Microsoft BASIC were written by Monte Davidoff in 1975, originally for the Altair, which used an Intel 8080 CPU. The source code had been lost for years, until Bill ...
user avatar
  • 5,690
36 votes

Did any PC software floating point use non-IEEE format?

The BASIC built into the ROM of the original IBM PC, as well as the BASICA and GW-BASIC programs, and therefore all software written in the language, used Microsoft Binary Format for floating-point ...
user avatar
  • 5,690
33 votes
Accepted

Why did the 8087 need a special socket?

But why was the 8087 designed such that it needed a special socket? Because the 8087 is a processor EXTENSION, not another CPU. The 8087 has, except for a few lines, exactly the same signals and ...
user avatar
  • 166k
33 votes
Accepted

What aspect of portable floating point did Java back down on?

The range of intermediate results. The Java Language Specification, 2nd Ed. relaxed the evaluation rules for floating-point expressions by introducing the notion of an ‘FP-strict’ expression, defined ...
user avatar
  • 16.4k
31 votes
Accepted

Detecting the external x87 FPU

The documented way to detect an x87 FPU is to attempt to initialise it, and then read its control word (FPU_STATUS must be set to some non-zero value first): FNINIT FNSTSW WORD PTR [FPU_STATUS] This ...
user avatar
30 votes
Accepted

What did Pete Stewart think he knew about efficient implementation of floating point denormals?

As far as I am familiar with the genesis of the IEEE-754 floating-point standard from the literature, G. W. Stewart never looked at implementation cost for the support of gradual underflow. He was ...
user avatar
  • 921
27 votes

Why not use fractions instead of floating point?

There is a mathematical problem with your idea. If you choose to store fractions with a fixed-length numerator and denominator, that's works fine until you try to do arithmetic with them. At that ...
user avatar
  • 6,320
24 votes

Why did 8-bit Basic use 40-bit floating point?

Using a 32 bit signed mantissa and 8 bit unsigned exponent has one major advantage: You can re-use 32 bit integer math functions for operating on the mantissa. That re-use saves memory. It may even be ...
user avatar
  • 13.7k
23 votes
Accepted

Why the change in layout of single and double precision in floating-point registers?

When you have a small transistor budget, it is considerably easier to design your circuitry around a single representation format - the most capable one - and treat converting other formats to and ...
user avatar
  • 16k
21 votes

Did any compiler fully use Intel x87 80-bit floating point?

I worked for Borland back in the days of the 8086/8087. Back then, both Turbo C and Microsoft C defined long double as an 80-bit type, matching the layout of Intel's 80-bit floating-point type. Some ...
user avatar
20 votes

Why not use fractions instead of floating point?

Floating-point isn't just about representing numbers that have fractional parts. It's also about representing numbers that are very large, or very small, in a way that allows extra range by ...
user avatar
  • 11.3k
18 votes
Accepted

Why does Sinclair BASIC have two formats for storing numbers in the same structure?

The ZX Spectrum has two formats for storing numbers, both 40 bits, or five bytes. Jup, like many other machines - one for float and one for integer. The second is some kind of 16-bit integer ...
user avatar
  • 166k
18 votes
Accepted

Commodore BASIC and binary floating point precision

This example reveals a rounding error under Commodore BASIC V2.0: A=0.3:B=0.6:IF A+B<>0.9 THEN PRINT A+B-0.9 Running this on a C64 yields a difference of 2.32830644e-10. Other pairs that ...
user avatar
  • 4,080
18 votes
Accepted

Which x87 first acquired the ability to flush denormal to zero?

Full disclosure: I worked on the x87 FPU of a 486-class CPU at a math-coprocessor company in the early 1990s and thereafter worked at AMD, where I was on the 3DNow! design team and the design team for ...
user avatar
  • 921
17 votes

What was the last x86 CPU that did not have the x87 floating-point unit built in?

All Intel x86 CPUs since the 80486 line have included floating point instructions, i.e. everything from the Pentium* onward. So the last Intel processor to lack an on-board floating-point unit (FPU) ...
user avatar
  • 7,564
17 votes
Accepted

When did game consoles begin including FPUs?

The first major console to incorporate an IEEE 754 floating point unit would be the N64. The main use of them in games is for the mathematical operations involved when transforming in-game 3D objects ...
user avatar
17 votes

Why did 8-bit Basic use 40-bit floating point?

It's not a power of 2, not a nice round number But it is :-) 1 byte exponent (with an assumed 1 bit always equal to one), 4 bytes mantissa, at least on the ZX Spectrum – see the ZX Spectrum manual. ...
user avatar
17 votes

Did any PC software floating point use non-IEEE format?

Half-precision wasn't a IEEE-754 standard format before 2008 Several earlier 16-bit floating point formats have existed including that of Hitachi's HD61810 DSP 2 of 1982, Scott's WIF [3] and the 3dfx ...
user avatar
16 votes

Where did the free parameters of IEEE 754 come from?

Well, the first thing to remember about these binary formats you're talking about (there were also decimal formats) is that they are the interchange formats; it's not required that hardware, or even ...
user avatar
  • 20k
15 votes

Floating point performance of classic minicomputers

There are nearly endless benchmarks (see a short list of relevance at Benchmark Programs and Reports on the Top500 site) and it may need a bit of work to understand each benchmark's implications (see ...
user avatar
  • 166k
15 votes

Why not use fractions instead of floating point?

Point by point. faster addition/subtraction No: 8/15 + 5/7 is evaluated as 131/105 [(8*7 + 15*5)/(7*15)], so 3 multiplications for one single addition/subtraction. Plus possibly reduction easier to ...
user avatar
  • 249
14 votes
Accepted

What was the performance penalty for denormal inputs on 80s-era FPUs?

The MC68882 was relatively well-regarded among 1980s FPUs. Digging out accurate timing information takes some effort, but it appears that handling denormalised values was only moderately burdensome ...
user avatar
  • 16k

Only top scored, non community-wiki answers of a minimum length are eligible