📄 binpolydiv.cc.txt
字号:
// BinPolyDiv.h -- declarations for BinPolyDiv class// Todd K. Moon#include "BinPolyDiv.h"BinPolyDiv::BinPolyDiv(int in_g, int in_p){ p = in_p; mask = (1<<p)-1; g = in_g & mask; state = 0;}int BinPolyDiv::div(unsigned char *d, int n, unsigned char *q, int "ientdegree, int &remainderdegree)// divide d by g. Return quotient in q and remainder as return value (integer)// d has d0 first, so start at upper end of d and work back.{ int i,j; unsigned char out; int outdeg=n-p; quotientdegree=0; state = 0; // Fill in the blanks ... return state;}int BinPolyDiv::remainder(unsigned char *d, int n,int &remainderdegree)// divide d by g. Return remainder as return value (integer)// d has d0 first, so start at upper end of d and work back.{ int i,j; unsigned char out; state = 0; // Fill in the blanks ... return state;}int BinPolyDiv::rem1(unsigned char *d, int n)// divide d by g. Return remainder as return value (integer)// d has d0 first, so start at upper end of d and work back.// This function does not bother to determine the remainderdegree{ int i,j; unsigned char out; // Fill in the blanks ... return state;}int BinPolyDiv::rem2(unsigned char *d, int n,int &remainderdegree)// divide d by g. Return remainder as return value (integer)// d has d0 first, so start at upper end of d and work back.// This function does not clear the state to 0, and does not perform // the initial shift, so incremental operations can be performed.{ int i,j; unsigned char out; // Fill in the blanks ... return state;}/*Local Variables:compile-command: "gcc -c -g BinPolyDiv.cc"End:*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -