maximum value for type float in c#

前端 未结 8 1620
你的背包
你的背包 2021-02-12 14:27

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

8条回答
  •  失恋的感觉
    2021-02-12 15:26

    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
    

提交回复
热议问题