objective-c equivalent to c++ numeric_limits::max()

582 views Asked by At

I've gotten used to utilizing the numeric_limits part of the C++ STL for initializing numeric types (int,float, etc.) to their largest possible value. I.e. int i=numeric_limits::max()

Is there an equivalent to this in objective-c? I've seen using INT_MAX and FLT_MAX in google searches, but it seems like there should be a better way.

1

There are 1 answers

2
Jasarien On BEST ANSWER

There is:

NSIntegerMax, NSIntegerMin, CGFLOAT_MAX etc.

These are sufficient for getting the numeric limits.