objective c - How to prevent division by zero when the denominator is a CGFloat? -


I have a number that is a CGFLOT and I want to divide it by a few numbers. How can I ensure that the separator is not equal to zero or NaN? The following example examines the separator before partition to ensure that it is not 0 or NaN

CGFLot dividend = 5f; CGFloat divisor = 3.f; If (! (Adnan (divisor)) separator == 0.f)) {CGFloat quotient = dividend / separator; }

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -