# What is max value of?

Hello all,

For whatever reason, I am having a terrible time finding what the maximum value of a Single or Double is. I am not interested in its precision, as I am only wanting 1 or 2 decimal places.

The docs show for a Single:
"Numerical limits
The maximum value of a single is: ±3.40282346638528859811704183484516925e+38
The minimum value towards zero is: ±1.40129846432481707092372958328991613e-45 "

So does this mean that the real max value is 3.40? Or can this go up to 100.40? This also appears to say that a Single can never be 0.0 - is that true?

For a Double, the docs show:
"Numerical limits
The maximum value of a double is: ±1.79769313486231570814527423731704357e+308
The minimum value towards zero is: ±4.94065645841246544176568792868221372e-324 "

So does this mean that the max value is 1.79?? This also appears to say that a Double can never be 0.0 - is that true?

Enlightenment?

Thanks all,
Tim

Scientific notation: e means to multiple by 10.

So for single 3.4 has 38 zeroes after the decimal and 45 zeroes before.

For doubles it’s 1.78 with 308 zeroes after and 324 before the decimal.

In either case, it’s a very large number.

Singles/Doubles can be approximately zero and so close you can’t see the difference but never assume that comparing to 0.0 will work because the precision (having a number 7 or more places past the decimal) can be a pain. Figure out what the smallest difference can be and test that for zero. Perhaps it’s 0.009. Anything smaller than that is considered zero.

1.79 x 10^308

or
179,769,313,486,231,570,814,527,423,731,704,357 (with 272 zeros after it)

Why do you infer that a single or double can never be ZERO?

Oops. I actually had the before and after decimals reversed but I hope you get the point.

Lol@Dave S that should be posted in the Pro-forum