maximum value for type float in c#

前端 未结 8 1631
你的背包
你的背包 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:29

    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.

提交回复
热议问题