108 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, ...
dirkt's user avatar
  • 26.1k
68 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 ...
phuclv's user avatar
  • 3,542
58 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. ...
Davislor's user avatar
  • 8,549
57 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, ...
Stephen Kitt's user avatar
56 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 ...
Peter Cordes's user avatar
  • 2,925
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 ...
Raffzahn's user avatar
  • 213k
49 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 ...
JeremyP's user avatar
  • 11.4k
47 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 ...
Davislor's user avatar
  • 8,549
45 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 ...
supercat's user avatar
  • 34.7k
37 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 ...
Davislor's user avatar
  • 8,549
35 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 ...
user3840170's user avatar
  • 21.6k
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 ...
Raffzahn's user avatar
  • 213k
32 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 ...
Stephen Kitt's user avatar
31 votes

Why was BASIC's INT() a floor, and not a truncate?

It Has (Almost) Always Been Floor Since at least 1966, with Dartmouth BASIC V3, the behaviour of INT is defined as as delivering an integer not greater than X - which otherwise may be called FLOOR. ...
Raffzahn's user avatar
  • 213k
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 ...
njuffa's user avatar
  • 1,446
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 ...
alephzero's user avatar
  • 6,646
26 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 ...
Pete Becker's user avatar
26 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's user avatar
  • 15.1k
24 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 ...
Chromatix's user avatar
  • 16.7k
21 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 ...
Raffzahn's user avatar
  • 213k
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 ...
Ken Gober's user avatar
  • 11.4k
20 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, 4 bytes mantissa (with an assumed 1 bit always equal to one and reused as a sign), at least on the ZX Spectrum – see the ...
Radovan Garabík's user avatar
19 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 ...
Peter B.'s user avatar
  • 4,437
18 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) ...
Kaz's user avatar
  • 8,036
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 ...
njuffa's user avatar
  • 1,446
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 ...
Matthew Barber's user avatar
17 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 ...
cjs's user avatar
  • 24.6k
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 ...
user3528438's user avatar
  • 1,209
17 votes
Accepted

Did any hardware-supported floating-point format ever fast-track integers?

Computer architectures designed by Sergey Lebedev did not have a separate integer unit. Integers were represented as unnormalized floating point values with the exponent chosen to make the LSB have ...
Leo B.'s user avatar
  • 18.3k
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 ...
Raffzahn's user avatar
  • 213k

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