python中求取余数用的是 % ,也就是百分号。a % b = c
参考:https://zhuanlan.zhihu.com/p/412338505
向下取整:int(a)
参考:https://blog.csdn.net/u010087338/article/details/121598961
def Cal(y): yIndex = (y-32.601709392)/0.000833 zheng = int(yIndex) yu = yIndex - zheng return yIndex
改进后:
def Cal(y): yIndex = (y-32.601709392)/0.000833 zheng = int(yIndex) yu = yIndex - zheng if(yu>0): return zheng+1; else: return zheng
行号:Cal( !y! )
标签:zheng,return,python,yIndex,int,取整,Cal,取余 From: https://www.cnblogs.com/2008nmj/p/16944441.html