📜  Python – cmath.nanj 常量

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

Python – cmath.nanj 常量

cMath 模块包含许多用于复数数学运算的函数。 cmath.nanj常量用于获取复数 nan(非数字)。

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

示例 #1:

Python3
# Python code to implement
# the cmath.nanj constant
        
# importing "cmath"
# for mathematical operations  
import cmath 
    
# Print the value of nanj 
val = cmath.nanj 
print(val)


Python3
# Python code to implement
# the cmath.nanj constant
        
# importing "cmath"
# for mathematical operations  
import cmath 
    
# use of cmath.nanj 
val = type(cmath.nanj)
print(val)


输出:

nanj

示例 #2:

Python3

# Python code to implement
# the cmath.nanj constant
        
# importing "cmath"
# for mathematical operations  
import cmath 
    
# use of cmath.nanj 
val = type(cmath.nanj)
print(val)

输出: