What is the minimum / maximum scale of floats and doubles in Objective-C under OS X?

I have already googled and checked limits.h without any results.

I hope there are constants that I can hide somewhere.

+4
source share
2 answers

You can use FLT_MIN, FLT_MAX:

NSLog(@"MIN=%f;MAX=%f", FLT_MIN, FLT_MAX);

Output:
MIN=0.000000;MAX=340282346638528859811704183484516925440.000000
+7
source

You can use FLT_MINand FLT_MAXto Float and values DBL_MIN, and DBL_MAXto double the value to find the value of the minimum value.

Keep in mind that this is the minimum value. The minimum numeric value for float -FLT_MAX, and for double it-DBL_MAX

Their values ​​are equal to:

FLT_MIN:0.000000(magnitude value, in real minimum float value= -FLT_MAX)

FLT_MAX:340282346638528859811704183484516925440.000000

DBL_MIN:0.000000(magnitude value, in real minimum float value= -DBL_MAX)

DBL_MAX:179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000
+4
source

Source: https://habr.com/ru/post/1524207/


All Articles