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 without this symbol?
msdn says RANGE: ±1.5 × 10^−45 to ±3.4 × 10^38, but that did not help me.
Yes it has 4 bytes only but it is not guaranteed.
Precision: 6 to 9 significant digits, depending on usage. The number of significant digits does not depend on the position of the decimal point.
Float is a datatype which is used to represent the floating point numbers. It is a 32-bit IEEE 754 single precision floating point number ( 1-bit for the sign, 8-bit for exponent, 23*-bit for the value.
The "E+38" format is the default. If you'd like to see the whole number, specify a different format like this:
float.MaxValue.ToString("#")
This will result in:
340282300000000000000000000000000000000
Here are some additional formats: http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With