码迷,mamicode.com
首页 > 其他好文 > 详细

高精度求模

时间:2016-09-09 13:31:19      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:

int hmod(string a,int b)//高精度取余单精度 输出余数
{
    int temp=0;
    unsigned long len=a.length();
    for(int i=0;i<len;i++)
        temp=(temp*10+a[i]-0)%b;
    return temp;
}

 

高精度求模

标签:

原文地址:http://www.cnblogs.com/wangmenghan/p/5856121.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!