If you write ‘if( 9223372000000000000 == c )’ or ‘if( 9223372129999999999 == c )’, it will work too. Therefore, it holds between 6 and 9 digits, according to documentation.
Try "{0:F}" and "{0:N}" specifiers too.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In the code below, I have 2 questions:
1-How to show the full value stored in variable c?
2-The documentaion states that float can hold 6 to 9 digits only, yet its holding a larger value (if result is true) - How is this possible?
float c = 9223372036854775807;
if ( 9223372036854775807==c ){
Console.WriteLine("{0}",c); // c = 9.223372E+18 Why c shows this value in display?
Console.WriteLine("{0:E15}",c); // Even worse...9.223372040000000E+018
}
Thanks.
If you write ‘if( 9223372000000000000 == c )’ or ‘if( 9223372129999999999 == c )’, it will work too. Therefore, it holds between 6 and 9 digits, according to documentation.
Try "{0:F}" and "{0:N}" specifiers too.