Fixed-point arithmetic: Difference between revisions

Content deleted Content added
No edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
No edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
Line 132:
 
===Division===
The division of fixed point numbers iscan bestbe understood as the division of two fractions of potentially different denominators (scaling factors). With {{frac|p|q}} and {{frac|r|s}} (where p q r s are all integers), the naive approach is to rearrange the fraction to form a new scaling factor (s/q):
 
: (p/q) / (r/s) = (p÷r) / (s÷q)