Content deleted Content added
Artoria2e5 (talk | contribs) No edit summary Tags: Mobile edit Mobile web edit Advanced mobile edit |
Artoria2e5 (talk | contribs) No edit summary Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
Line 140:
For example, if ''a'' = 1.23 is represented as 123 with scaling 1/100, and ''b'' = 6.25 is represented as 6250 with scaling 1/1000, then simple division of the integers yields 123÷6250 = 0 (rounded) with scaling factor (1/100)/(1/1000) = 10. If ''a'' is first converted to 1,230,000 with scaling factor 1/1000000, the result will be 1,230,000÷6250 = 197 (rounded) with scale factor 1/1000 (0.197). The exact value 1.23/6.25 is 0.1968.
As a corollary of the above, if the desired new scaling factor is ''x'', then the choice of ''n'' shall be (s/qx) by basic algebra. If q and s are the same, this simplifies to (1/x). If the same precision (1/q) is to be kept, we
: (p/q) / (r/q) = (qp/r) / q
|