Vyacheslav Vyacheslav - 3 months ago 14
Swift Question

long long constant number in swift

I'm looking Swift alias for Objective-C constant

long long int
and
float
numbers.

That is, how can this :
1000LL
and
.1f
be converted into Swift code?

No information found here:

https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithCAPIs.html

Answer

You use as-casting when you need to specify literal types in Swift.

1000LL -> 1000 as Int64

.1f -> 0.1 as Float