跳到主要内容

转换步骤

                          I-n

现在只剩下 2 这个因子. 视情况, 可以用算术左移 (I-n) 位或算术右移 (n-I) 位来实现. 偏移量 S 随后用整数加法加上即可.

把 NGP 坐标转换为整数设备坐标的步骤如下:

               1.   move coordinate to a register and extend sign
2. integer multiply by Q (if necessary)
3. arithmetic shift left by (I-n)
4. integer add S

这一步骤通常比下面的步骤快得多:

               1.   move coordinate to register and extend sign
2. float fractional coordinate
3. floating point multiply
4. floating point add
5. conversion to fixed point
       [ This RFC was put into machine readable form for entry ]
[ into the online RFC archives by BBN Corp. under the ]
[ direction of Alex McKenzie. 1/97 ]