+ 1
Can someone please describe why we need Double within the expression?
5 Réponses
+ 2
Double is a cast. The variable is an integer, and will not multiply with a double. To fix this, the integer is cast into a double before multiplying. This causes the multiplication to be done with two doubles.
+ 2
1.5 is a double,4 isn't. you have to convert 4 to double to multiply. hope I helped :)
+ 1
You use double, if the expression includes a string literal.
Source:https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/StringsAndCharacters.html
+ 1
I Believe Double is basically used to return a double value.
0
I believe that it allows swift to read and process decimal numbers. With out using "Double" swift only reads whole numbers.