My code below gives a breakpoint error:
func doScore(num: Float, binaural: Bool, noise: Bool) -> Float {
if 50 ... 100 ~= num{
let numDoubled = num + (Float(noise.intValue()!) * weighting)// <--- this is where I get my error
return numDoubled.rounded()
}
All I want to do is multiply the number I am putting into the function by the value of binaural or noise which are boolean values. To do this I am getting the Int value however I need it to be a float as 0 or 1 since the number I am putting in is a float. Why would this cause a crash? Thanks.