借助於sympy.smoothness()方法,我們可以找到給定數字的平滑度和power-smoothness。數字的平滑度是其最大的首要因素,而power-smoothness是其最大的因數提高的因數。
用法:
smoothness(n)
參數:
n - 它表示要計算的平滑度和power-smoothness的數字。
返回值:
返回給定數字的平滑度和power-smoothness元組。
示例1:
# import smoothness() method from sympy
from sympy.ntheory.factor_ import smoothness
n = 64
# Use smoothness() method
smoothness_n, power_smoothness_n = smoothness(n)
print("The smoothness and power-smoothness of {} is {} and {} respectively".
format(n, smoothness_n, power_smoothness_n))
輸出:
The smoothness and power-smoothness of 64 is 2 and 64 respectively
示例2:
from sympy.ntheory.factor_ import smoothness
n = 2**4 * 13
# Use smoothness() method
smoothness_n, power_smoothness_n = smoothness(n)
print("The smoothness and power-smoothness of {} is {} and {} respectively".
format(n, smoothness_n, power_smoothness_n))
輸出:
The smoothness and power-smoothness of 208 is 13 and 16 respectively
相關用法
- Python next()用法及代碼示例
- Python os.dup()用法及代碼示例
- Python set()用法及代碼示例
- Python os.abort()用法及代碼示例
- Python os.WEXITSTATUS()用法及代碼示例
- Python os.fchmod()用法及代碼示例
- Python PIL getpixel()用法及代碼示例
- Python PIL putpixel()用法及代碼示例
- Python os.sysconf()用法及代碼示例
- Python os.confstr()用法及代碼示例
- Python os._exit()用法及代碼示例
- Python cmath.log()用法及代碼示例
- Python Tensorflow cos()用法及代碼示例
- Python sympy.rf()用法及代碼示例
注:本文由純淨天空篩選整理自rupesh_rao大神的英文原創作品 Python | sympy.smoothness() method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。