Ich habe eine Variable (float slope
), die manchmal einen Wert von Nan hat, wenn sie ausgedruckt wird, da manchmal eine Division durch 0 auftritt.Objective C - float checking für nan
Ich versuche, ein wenn-sonst zu tun, wenn das passiert. Wie kann ich das machen? if (slope == nan)
scheint nicht zu funktionieren.
möglich Duplikat von [isNan in objective c] (http://stackoverflow.com/questions/2109257/isnan-in-objective-c) –
Objective-C für float oder double: 'isnan (slope)'; Swift für floatingPointType: 'slope.isNaN' –