摘要:
本篇文章介绍一个整数的以10为底的对数的整数部分,即对于整数N,求log10(N)整数部分方法一 :unsigned int v; //32位非0整数 int r; // r保存结果int t; //临时变量static unsigned int const PowersOf10[] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};t = (IntegerLogBase2(v) + 1) * 1233 >> 12; //使用之前介绍过的... 阅读全文