P in constant declaration

后端 未结 4 1835
醉话见心
醉话见心 2020-12-09 01:46

In java.lang.Double, there are the following constant declarations:

public static final double MAX_VALUE = 0x1.fffffffffffffP+1023;
public stati         


        
4条回答
  •  失恋的感觉
    2020-12-09 02:34

    The p syntax if used for defining a double literal in hex. This is useful when you want to define its exact representation but isn't useful in general code because you want the double to be a decimal value rather than some hex pattern.

提交回复
热议问题