Floating Point Addition - hardware/software

Click For Summary
Floating point addition in x86 architecture involves adjusting the exponents of the numbers being added to align their mantissas. When adding numbers with differing exponents, the mantissa of the number with the lower exponent is shifted right to match the larger exponent, which can lead to truncation errors. This process confirms that the larger exponent dictates the alignment for addition. The discussion also touches on the implications of this method for adding arrays of numbers, suggesting that adding from smaller to larger may be preferable to minimize error, as the larger exponent ultimately governs the result.
coolul007
Gold Member
Messages
271
Reaction score
8
Can someone explain to me how floating point addition is implemented on a x86 in hardware or software. I would like to find out what method is used to add varying number size. if I have a 1 X 10^-100 + 2 X 10^50. are the exponents average for a common ground or does the large one rule etc. or is it something else?
 
Technology news on Phys.org
The fractional (mantissa) part of the number with the lower exponent is shifted to the right before addition is performed. This results in truncation error.
 
rcgldr said:
The fractional (mantissa) part of the number with the lower exponent is shifted to the right before addition is performed. This results in truncation error.

Thanx, for the answer, this came up in a question in the math section "is it better to add an array of numbers from smaller to larger or larger to smaller". Everyone answered small to large, which got to me to thinking about what really goes on...Therefore the larger exponent rules.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 0 ·
Replies
0
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K