?? utility.c
字號:
/* | | Copyright disclaimer: | This software was developed at the National Institute of Standards | and Technology by employees of the Federal Government in the course | of their official duties. Pursuant to title 17 Section 105 of the | United States Code this software is not subject to copyright | protection and is in the public domain. | | We would appreciate acknowledgement if the software is used. |*/#include <stdlib.h>#include <math.h>#include <stdio.h>#include <ctype.h> #include <string.h>#include "utility.h"/* -------------------------------------------------------------- */int IntPower( int k, int m){ int ival, i; ival=1; for(i=1; i<=m;i++) ival *=k; return(ival);}; /* -------------------------------------------------------------- */unsigned short int LongParity(unsigned long int long_word){ unsigned short int parity,i; parity = 0; for(i=1;i<=32;i++) { parity=parity^(unsigned short int)(long_word%2); long_word/=2; } return(parity);} /* -------------------------------------------------------------- */unsigned short int Parity(unsigned short int short_word){ unsigned short int parity,i; parity = 0; for(i=1;i<=16;i++) { parity=parity^(unsigned short int)(short_word%2); short_word/=2; } return(parity);} /* -------------------------------------------------------------- */
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -