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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -