Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [floating-point]

Floating point arithmetic: number formats, instruction sets, software and hardware implementations.

Filter by
Sorted by
Tagged with
18 votes
3 answers
3k views

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. The first is a floating point format, which consists of one exponent byte, and four mantissa bytes. The first bit of ...
Omar and Lorraine's user avatar
23 votes
1 answer
898 views

How is FSTSW AX implemented on the 80286/80287?

The x87 instruction set does not support direct transfers between general purpose registers and floating point registers. This is mainly a consequence of the 8087/80287/80387 being a separate chip ...
fuz's user avatar
  • 1,564
38 votes
1 answer
4k views

How did the 8086 interface with the 8087 FPU coprocessor?

The 8087 has many instructions - too many, it seems, to be encoded as part of the 8086 instruction set. How did the Intel 8086 interface with an Intel 8087 FPU that a user added? Consider the ...
Jet Blue's user avatar
  • 2,005
27 votes
8 answers
6k views

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

Nowadays floating point is usually either 32 or 64 bits, sometimes 16, occasionally 128. But of course, the Basic interpreters on the 8-bit machines, having to implement floating point in software ...
rwallace's user avatar
  • 61.4k
61 votes
7 answers
16k views

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

There is a paradox about floating point that I'm trying to understand. Floating point is an eternal struggle with the problem that real numbers happen to be both essential and incomputable. It's the ...
rwallace's user avatar
  • 61.4k
54 votes
11 answers
23k views

Why not use fractions instead of floating point?

Considering all those early home computers, the ZX Spectrum, the Galaksija, the VIC-20, the Apple I/II/III, and all of those, they all have some 8-bit CPU which does integer arithmetic and no floating ...
Omar and Lorraine's user avatar
33 votes
3 answers
4k views

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

Java was released under the slogan 'write once, run anywhere'; while its adoption was probably more about 'now we have a language that provides garbage collection in a familiar workflow and with a ...
rwallace's user avatar
  • 61.4k
32 votes
7 answers
5k views

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

During the 1980s, prior to the 486 (well, strictly speaking, prior to the discontinuing of the 486SX in the nineties), IBM PCs and compatibles had hardware floating point only in the form of an ...
rwallace's user avatar
  • 61.4k
24 votes
2 answers
7k views

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

This Wikipedia page says the following: Most x86 processors since the Intel 80486 have had these x87 instructions implemented in the main CPU So the above quote implies that some CPUs that were ...
user12280's user avatar
  • 293
22 votes
6 answers
2k views

Commodore BASIC and binary floating point precision

I am mildly curious that though the 6502 provides BCD arithmetic which would be useful for implementing decimal floating point, Commodore BASIC uses, like all (?) Micro-Soft BASIC, binary floating ...
rwallace's user avatar
  • 61.4k
9 votes
10 answers
3k views

How did dusty deck Fortran handle overflow?

In Fortran 77, numerical code that ran on IBM, CDC, Cray etc, how was overflow typically handled? Did it raise an exception? (I would expect such an exception to be inexact on vector machines, i.e. to ...
rwallace's user avatar
  • 61.4k
8 votes
1 answer
762 views

How can floating point addition be so slow on a BESM-6?

In the BESM-6 technical manuals — for example, in the ALU description, page 4 — there is a table specifying min/max/average instruction latencies in clock cycles (the last 3 columns; the ...
Leo B.'s user avatar
  • 19.3k
4 votes
1 answer
568 views

Clear description of MS BASIC number → string conversions?

I'm failing to find a concise document that describes the formatting used by (6502) MS BASIC when converting internal floating-point numbers to text for display in PRINT, STR$, etc. I know it has a ...
Maury Markowitz's user avatar
3 votes
1 answer
759 views

What were the most common applications of the 8087?

The original IBM PC had a slot for the 8087 floating-point coprocessor. This was a somewhat esoteric feature at the time – previous microcomputers had done all their floating-point in software – but ...
rwallace's user avatar
  • 61.4k