Recently, I have been trying fast, and I ran into a pretty simple problem.
In Obj-C, when I want to get fractional numbers for a float, I would do the following:
float x = 3.141516
int integer_x = (int)x;
float fractional_x = x-integer_x;
in Swift:
let x:Float = 3.141516
let integerX:Int = Int(x)
let fractionalX:Float = x - integerX
-> this leads to an error due to mismatch types
Any idea how to do this correctly?
Thanks at Advance
Malta
Malte source
share