2 ms·
I don't know Swift, but you are declaring Double while using Int. 6.2 seconds seem pretty quick for something that I would expect to be: never.
by timeon 2y ago
I don't know Swift, but you are declaring Double while using Int. 6.2 seconds seem pretty quick for something that I would expect to be: never.
- Hamuko 2y agolet x: Double = 2 let y = 5 / x y is a Double with a value of 2.5. let x: Int = 2 let y = 5 / x y is an Int with a value of 2. let x: Int = 2 let y: Double = 5 / x Code doesn't compile.
- happytoexplain 2y agoThey are using integer literals, not Ints. Any type can declare the ability to be representable by any literal. Double can be represented by floating point literals or integer literals (since Double, the type, can represent integers, the category of number).