INFINITY in Swift Lang -
according apple's documentation, swift doesn't support preprocessor directives. in c/objective-c "infinity" definition useful checks. so, how number never less another?
there buildin infinity , check function. , directly compare them <.
var infinity = double.infinity var isinfinite = infinity.isinfinite var somedouble = 234432.0 if somedouble < infinity { println("less than") } else { println("small than") } // , answer less than.
Comments
Post a Comment