when i do this:
float x = float.MaxValue;
I have the result: 3.40282347E+38
What is E+38? how can I represent the maximum number withou
It's approx. 340 000 000 000 000 000 000 000 000 000 000 000 000
If you use Dan's code, you'll get this as a result:
340282300000000000000000000000000000000
Old question, but here's the min and max in string format.
Using float.Parse
-340282356779733642999999999999999999999 to 340282356779733642999999999999999999999
Using float.MinValue.ToString("#") and float.MaxValue.ToString("#")
-340282300000000000000000000000000000000 to 340282300000000000000000000000000000000
Using float.MinValue.ToString() and float.MaxValue.ToString()
-3.402823E+38 to 3.402823E+38
3.4e38 is 3.4 * 10^38 or 340000000000 ... (37 zeros)
additional information:
http://msdn.microsoft.com/en-us/library/b1e65aza(v=vs.71).aspx
That is Scientific Notation.
5E+2 =
5 x 10 ^ 2 =
5 x 10 * 10 =
5 * 100 =
500
In other words, that's how many decimal places you move the decimal point to calculate the result. Take 5, move it over 2 places, end up with 500. In your example, you need to take your number, 3.40282347
and move the decimal place over 38 times!
Try the following code:
float f = float.MaxValue;
Console.WriteLine("Origianl Value: " + f);
Console.WriteLine("With Zeros:" + f.ToString("0"));
Value
Origianl Value: 3.402823E+38
With Zeros:340282300000000000000000000000000000000
Sorry to necro an old thread but google lead me here and I didn't find a satisfactory answer. I'm sure google will lead someone else here.
The float.h library includes the maximum values for float and others in c. FLOAT_MAX is equal to 340282346638528859811704183484516925440, that is the maximum value that float can store.
I'm not an expert in C but I would imagine this value is universal and wouldn't depend on a x32 or x64 operating system.