我想做一个函数:
def accuracy(number, index):
例如
accuracy(2.5e-10, -5)
将返回 0。accuracy(49, 2)
将返回 0。accuracy(50, 2)
将返回 100。所以基本上它会四舍五入到指数的最接近的 10 次方
index
你会怎么做?
我想做一个函数:
def accuracy(number, index):
例如
accuracy(2.5e-10, -5)
将返回 0。
accuracy(49, 2)
将返回 0。
accuracy(50, 2)
将返回 100。
所以基本上它会四舍五入到指数的最接近的 10 次方index
你会怎么做?