Binary scaling: Difference between revisions

Content deleted Content added
Robin48gx (talk | contribs)
Line 9:
Binary points obey the mathematical laws of [[exponentiation]].
 
To give an example, a common way to use [[Arbitrary-precision arithmetic|integer arithmetic]] to simulate floating point, using 32 bit numbers, is to multiply the coefficients by 65536.
 
Using [[binary scientific notation]], this will place the binary point at 1B16B16.
 
For instance, to represent 1.2 and 5.6 floating point real numbers as 1B16B16 one multiplies them by 2<sup>16</sup>, giving 78643 and 367001.
 
Multiplying these together gives
Line 19:
28862059643
 
To convert it back to 1B16B16, divide it by 2<sup>16</sup>.
 
This gives 440400B16, which when converted back to a floating point number (by dividing again by 2<sup>16</sup>, but holding the result as floating point) gives 6.71999.