Questions tagged [floating-point]
Floating point arithmetic: number formats, instruction sets, software and hardware implementations.
56
questions
5
votes
3
answers
393
views
Examples of floating-point numbers that don’t round-trip losslessly through text conversion in Microsoft BASIC
For a long time I thought it was kind of crazy that 8-bit Microsoft BASIC stores numeric constants in ASCII and has to parse them into its 32- or 40-bit floating point format at runtime. Why not parse ...
22
votes
1
answer
456
views
Looking for help understanding a 'Reciproot' routine on the Manchester Mark I (1951)
I'm hoping to understand a routine written for the Manchester Mark I [NOTE: a comment from Raffzahn suggests this may be the Ferranti (wikipedia link) and not the Manchester Mark I] which computes ...
6
votes
1
answer
317
views
What is the earliest use in C of indexing the bits of a float or double to sample a table lookup?
One common way to produce an approximation of a function like the logarithm or the exponential is to precompute a table of values (a lookup table) for the output or some intermediate stage of the ...
9
votes
1
answer
436
views
Was the design of the PDP-11 Floating Point Processor responsible for C's willingness to do arithmetic on floats at double precision?
The Wikipedia page on PDP-11 architecture has a very interesting bullet point in the section on the Floating Point Processor extension to the basic architecture:
full floating point operations on ...
22
votes
1
answer
706
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 ...
9
votes
1
answer
427
views
How robust was floating point format output in pre-IEEE systems?
Most pre-IEEE floating point formats that used biased exponent and a 2's-complement mantissa without a hidden bit, were asymmetric. That is, there was a representable negative value which had no ...
8
votes
3
answers
599
views
Did the ARM-1 really outperform the 387?
According to a comment on https://news.ycombinator.com/item?id=31985142
The first benchmarks indicated the plain Archimedes had higher FP throughput than a 16MHz 386 with a 387.
The original ...
11
votes
4
answers
2k
views
Did any hardware-supported floating-point format ever fast-track integers?
The floating-point format on the ZX Spectrum has the unusual feature of special-casing small integers: Why does Sinclair BASIC have two formats for storing numbers in the same structure?
There are ...
4
votes
1
answer
205
views
Who were the members of the IEEE 754 working group?
The IEEE 754 working group began meeting in 1977, produced a draft standard for floating-point arithmetic by the beginning of the eighties, and had it formally ratified in 1985, by which time it was ...
32
votes
7
answers
4k
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 ...
4
votes
2
answers
1k
views
What was the first CPU/FPU without a hardware square-rooter?
The first programmable, electronic, general-purpose digital computer, ENIAC had a "square rooter":
five of the accumulators were controlled by a special divider/square-rooter unit to ...
5
votes
2
answers
303
views
Did any computer ever signal floating-point overflow purely with a sticky flag?
Every implementer of floating-point arithmetic, needs to think about how to signal overflow.
One possible way to do it is by raising an exception, though this creates the problem that 'exception' can ...
32
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 ...
7
votes
0
answers
247
views
What was this book about floating-point system design/construction?
A comment on the question Why did 8-bit Basic use 40-bit floating point? says the following (emphasis added):
Re, "Nowadays, floating point is usually either 32 or 64 bits." More ...
3
votes
1
answer
2k
views
What precision did the original PlayStation use?
The PlayStation 1 performed all calculations in fixed point. On the face of it, this is straightforward enough; it couldn't afford floating-point hardware, which was introduced only later, with the ...
16
votes
2
answers
2k
views
Why did the 8087 need a special socket?
The IBM PC included a coprocessor socket for the 8087 floating-point unit. Logical enough; some customers wanted to use the 8087 to make numeric calculations run faster.
But why was the 8087 designed ...
4
votes
1
answer
516
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 ...
12
votes
4
answers
2k
views
Why did decimal arithmetic slow down VisiCalc?
There is an excellent article about VisiCalc that goes into all the details about what happened and why, highly recommended if you are interested in that part of computing history. I was reading this ...
4
votes
2
answers
334
views
What was the first vector supercomputer?
I am trying to understand the trade-offs between scalar and vector machines, the threshold of complexity/transistor count/performance at which vector machines started to make sense.
As data points, ...
26
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 ...
32
votes
2
answers
4k
views
What did Pete Stewart think he knew about efficient implementation of floating point denormals?
The most controversial part of the IEEE 754 floating-point standard is gradual denormals. Typically they trap to software rather than being implemented in hardware. In the common case where a workload ...
2
votes
1
answer
221
views
How did VisiCalc decide how many decimal places to display?
VisiCalc represented numbers in BCD to be able to handle decimals precisely. But how did it decide how many decimal places to display?
In some screenshots like https://www.researchgate.net/figure/A-...
10
votes
3
answers
1k
views
What performance increase did an Amiga typically get with an FPU?
After seeing this question, I reminisced about how my old Amiga 2500/030 had a 68882 FPU unit. I recall that the Amiga's floating point routine library was smart enough to detect if you had an FPU or ...
3
votes
1
answer
634
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 ...
3
votes
2
answers
500
views
How did the NSA use vector supercomputers?
In the 80s, the NSA was a major customer of supercomputers. https://www.nsa.gov/Portals/70/documents/news-features/declassified-documents/cryptologic-quarterly/NSA_and_the_Supercomputer.pdf discusses ...
19
votes
1
answer
1k
views
Detecting the external x87 FPU
On modern processors the x87 FPU is integrated in the CPU chip, but it used to be a separate chip before the 80486. So is there any way to detect its presence, and maybe even its generation (8087, ...
10
votes
4
answers
2k
views
Why the change in layout of single and double precision in floating-point registers?
The Intel 8087 supported both single and double precision floating point, but only in memory; the on-chip registers were purely double precision. (Strictly speaking they were actually 80-bit extended ...
11
votes
3
answers
1k
views
How can I understand numerical precision of values in Microsoft BASIC (on the Dragon 32)?
I implemented a differential equation solver on my Dragon 32 (which uses Microsoft Extended Color BASIC) but the results I get quickly diverge from those I expect, which are the same as those I get ...
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 ...
9
votes
1
answer
968
views
What was the performance penalty for denormal inputs on 80s-era FPUs?
Some FPUs exhibit as much as an order of magnitude slowdown when given denormal inputs, due to having to trap to microcode to handle them.
Did early FPUs of the microprocessor era, exhibit substantial ...
6
votes
1
answer
396
views
Which x87 first acquired the ability to flush denormal to zero?
On modern Intel FPUs, you can set a flag to cause all denormals to be automatically flushed to zero. On some workloads, this improves performance.
I cannot find any mention of that flag in the data ...
6
votes
2
answers
521
views
Why did the CDC 6600 expand the word size to 60 bits?
According to http://www.quadibloc.com/comp/cp0201.htm
The CDC 1604 used 48-bit floating point with 11 bits exponent and 36 bits mantissa. There was also a double precision format (which I believe was ...
4
votes
5
answers
933
views
Z88DK ZX Spectrum "%f" printf not working
I'm attempting to compile a program in C for the ZX Spectrum using Z88DK.
However, I'm facing an issue when trying to use printf to print out the value of a float.
The code I'm trying to compile:
#...
10
votes
2
answers
567
views
Where to share/who may be interested in IEEE 16 bit half float library for Zilog Z80?
I have recently developed a half-float/16-bit float library (link to Github) for Zilog Z80. It was a part of my project to run some neural network and graphics POCs for ZX Spectrum.
The library uses ...
43
votes
3
answers
9k
views
Where did the free parameters of IEEE 754 come from?
It's clear where many of the design decisions of IEEE 754 floating point come from. For example, the binary format maximizes efficiency on binary hardware. And 32 and 64 bits for single and double ...
23
votes
1
answer
2k
views
How good was Woz's FP code?
I just came across this amazing 1976 article by Woz. In it he describes a relatively complete floating-point system for the 6502 with a 32-bit format (similar to earlier MS code).
I understand the ...
13
votes
3
answers
5k
views
When did game consoles begin including FPUs?
Floating-point coprocessors (FPUs) were an expensive, niche, add-on product for early desktop and home computers. but became commonplace by the mid-1990s, as they began to be included within the most ...
6
votes
3
answers
1k
views
Why is modulo operation an operator for integer types but only a function for floating-point ones?
In C, we have the % operator which finds remainder of division. But it's only applicable to integral types. For floating-point types we have to use fmod function from math.h. This makes an impression ...
56
votes
7
answers
14k
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 ...
22
votes
2
answers
6k
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 ...
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 ...
4
votes
2
answers
633
views
Did any early computers use a different radix to improve accuracy of rational arithmetic?
Fractions like a third, a fifth, a tenth and so on cannot be precisely represented in binary, because those would be recurring fractions and so would never fit in a (reasonable) data structure. And ...
6
votes
3
answers
265
views
How does the floating point conversion in Zuse's machines work?
Can someone please help me understand the floating point to readable decimal conversion algorithms of the Z1 and Z3? There is a patent in German containing all the information but I can't speak German....
4
votes
1
answer
325
views
ENIAC stands for Electrical Numerical Integrator And Calculator; what made it particularly suitable for numerical integration?
The acronym ENIAC stands for Electrical Numerical Integrator And Calculator.
The fact that it was simpy a numerical computer means it probably could be used to perform numerical integration in some ...
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 ...
17
votes
3
answers
2k
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 ...
8
votes
1
answer
719
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 ...
10
votes
1
answer
497
views
Which pre-IEEE computers had a single precision FPU and implemented double precision floats in software?
Before the formats of floating point numbers have been standardized in IEEE 754 in 1985, different vendors had used many different floating point formats, some of them listed on the Data Format and ...
6
votes
2
answers
772
views
Floating Point on Konrad Zuse's computers
From what I understand, with floating point arithmetic, shifting values up and down is important, since a floating point value essentially is an equation like 2e×m. This supposition may be supported ...
4
votes
2
answers
857
views
Using C64 floating point kernal routines with 16 bit integer
How to use floating point kernal routines for 16 bit arithmetics such as: $1234*$ABCD or $1234/$ABCD ?