1、python数据类型
- numerics, sequences, mappings, classes, instances, exceptions
- Numeric Types: int (包含boolean), float, complex
- int: unlimited length; float: 实现用double in C, 可用 sys.float_info查看
complex: real(实部) & imaginary(虚部),用z.real 和 z.imag来取两部分
具体运算以及法则参见:
https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex
2、例子
import sys
a = 3
b = 4
c = 5.66
d = 8.0
e = complex(c,d)
f = complex