📜  Python – cmath.infj 常量

📅  最后修改于: 2022-05-13 01:54:19.526000             🧑  作者: Mango

Python – cmath.infj 常量

cMath 模块包含许多用于复数数学运算的函数。 cmath.infj常量用于获得复数正无穷大。

下面的例子说明了上述函数的使用:

例子 :

Python3
# Python code to implement
# the cmath.infj constant
        
# importing "cmath"
# for mathematical operations  
import cmath 
    
# Print complex infinity
val = cmath.infj
print(val)


Python3
# Python code to implement
# the cmath.infj constant
        
# importing "cmath"
# for mathematical operations  
import cmath 
    
# Print complex infinity
val = complex(cmath.infj)
print(val)


输出:

infj

示例 2:

Python3

# Python code to implement
# the cmath.infj constant
        
# importing "cmath"
# for mathematical operations  
import cmath 
    
# Print complex infinity
val = complex(cmath.infj)
print(val)

输出:

infj