ScalarArithmetic 介绍
Scalararithmetic 使用隐式转换进行更好的 32 位和 64 位的数值类型转换。
示例:
let myHeight = 34.5let myWidth = 100.23 let sizeOfWindow = CGSize(width:myWidth, height:myHeight) let myDouble:Double = sizeOfWindow.height // .height is a CGFloatlet isLargerThan = 213.3 > sizeOfWindow.width // 213.3 is a Double//You can Now compare or do mathematical operations on the following: var doubleValue:Double = 5.0 var cgFloatValue:CGFloat = 5.0 var intValue:Int = 5 var int16Value:Int16 = 5 var int32Value:Int32 = 5 var int64Value:Int64 = 5 var uInt16Value:UInt16 = 5 var uInt32Value:UInt32 = 5 var uInt64Value:UInt64 = 5
ScalarArithmetic 官网
https://github.com/seivan/ScalarArithmetic
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。