swift-complex Swift 的复数处理

swift-complex 是 Swift 的复数处理。

let z0 = 1 + 1.ilet z1 = 1 - 1.iprintln(z0 * z1)            
// (2.0+0.0.i)println(z0 * z1 == z0 + z1) 
// trueprintln(z0 * z1 == 2)       
// true

 

© 版权声明
THE END
喜欢就支持一下吧
点赞220 分享
There are two ways of spreading light: to be the candle or the mirror that reflects it.
传递光亮有两种方式:成为一支蜡烛或当一面镜子