⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 javalang.doc8.html

📁 java语言规范
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html>
<head>
<title>The Java Language Specification The Package java.lang </title>
</head>
<body BGCOLOR=#eeeeff text=#000000 LINK=#0000ff VLINK=#000077 ALINK=#ff0000>
 
<a href="index.html">Contents</a> | <a href="javalang.doc7.html">Prev</a> | <a href="javalang.doc9.html">Next</a> | <a href="j.index.doc1.html">Index</a>
<hr><br>
 
<a name="14394"></a>
<center><h1>20.9  The Class  <code>java.lang.Float</code></h1></center>
<pre><a name="14399"></a>public final class <code><b>Float</b></code> extends Number {
<a name="2493"></a>	public static final float <code><b>MIN_VALUE</b></code> = 1.4e-45f;
<a name="2494"></a>	public static final float <code><b>MAX_VALUE</b></code> = 3.4028235e+38f;
<a name="2496"></a>	public static final float <code><b>NEGATIVE_INFINITY</b></code> = -1.0f/0.0f;
<a name="3543"></a>	public static final float <code><b>POSITIVE_INFINITY</b></code> = 1.0f/0.0f;
<a name="2497"></a>	public static final float <code><b>NaN</b></code> = 0.0f/0.0f;
<a name="2498"></a>	public <code><b>Float</b></code>(float value);
<a name="2499"></a>	public <code><b>Float</b></code>(double value);
<a name="2500"></a>	public <code><b>Float</b></code>(String s)
<a name="19820"></a>		throws NumberFormatException;
<a name="2501"></a>	public String <code><b>toString</b></code>();
<a name="2502"></a>	public boolean <code><b>equals</b></code>(Object obj);
<a name="2503"></a>	public int <code><b>hashCode</b></code>();
<a name="2504"></a>	public int <code><b>intValue</b></code>();
<a name="2505"></a>	public long <code><b>longValue</b></code>();
<a name="2506"></a>	public float <code><b>floatValue</b></code>();
<a name="2507"></a>	public double <code><b>doubleValue</b></code>();
<a name="2508"></a>	public static String <code><b>toString</b></code>(float f);
<a name="2509"></a>	public static Float <code><b>valueOf</b></code>(String s)
<a name="19819"></a>		throws NullPointerException, NumberFormatException;
<a name="2510"></a>	public boolean <code><b>isNaN</b></code>();
<a name="2511"></a>	public static boolean <code><b>isNaN</b></code>(float v);
<a name="2512"></a>	public boolean <code><b>isInfinite</b></code>();
<a name="2513"></a>	public static boolean <code><b>isInfinite</b></code>(float v);
<a name="2514"></a>	public static int <code><b>floatToIntBits</b></code>(float value);
<a name="2515"></a>	public static float <code><b>intBitsToFloat</b></code>(int bits);
<a name="2518"></a>}
</pre><a name="14404"></a>
<p><font size=+1><strong>20.9.1   </strong> <code>public static final float <code><b>MIN_VALUE</b></code> = 1.4e-45f;</code></font>
<p>
<a name="3494"></a>
The constant value of this field is the smallest positive nonzero value of type 
<code>float</code>. It is equal to the value returned by <code>Float.intBitsToFloat(0x1)</code>.
<p><a name="2303"></a>
<p><font size=+1><strong>20.9.2   </strong> <code>public static final float <code><b>MAX_VALUE</b></code> = 3.4028235e+38f;</code></font>
<p>
<a name="3523"></a>
The constant value of this field is the largest positive finite value of type <code>float</code>. It 
is equal to the value returned by <code>Float.intBitsToFloat(0x7f7fffff)</code>.
<p><a name="1410"></a>
<p><font size=+1><strong>20.9.3   </strong> <code>public static final float <code><b>NEGATIVE_INFINITY</b></code> =<br>-1.0f/0.0f;</code></font>
<p>
<a name="3554"></a>
The constant value of this field is the negative infinity of type <code>float</code>. It is equal to 
the value returned by <code>Float.intBitsToFloat(0xff800000)</code>.
<p><a name="3536"></a>
<p><font size=+1><strong>20.9.4   </strong> <code>public static final float <code><b>POSITIVE_INFINITY</b></code> =<br>1.0f/0.0f;</code></font>
<p>
<a name="3537"></a>
The constant value of this field is the positive infinity of type <code>float</code>. It is equal to 
the value returned by <code>Float.intBitsToFloat(0x7f800000)</code>.
<p><a name="1411"></a>
<p><font size=+1><strong>20.9.5   </strong> <code>public static final float <code><b>NaN</b></code> = 0.0f/0.0f;</code></font>
<p>
<a name="3558"></a>
The constant value of this field is the Not-a-Number value of type <code>float</code>. It is 
equal to the value returned by <code>Float.intBitsToFloat(0x7fc00000)</code>.
<p><a name="3682"></a>
<p><font size=+1><strong>20.9.6   </strong> <code>public <code><b>Float</b></code>(float value)</code></font>
<p>
<a name="3688"></a>
This constructor initializes a newly created <code>Float</code> object so that it represents the 
primitive value that is the argument.
<p><a name="3683"></a>
<p><font size=+1><strong>20.9.7   </strong> <code>public <code><b>Float</b></code>(double value)</code></font>
<p>
<a name="3704"></a>
This constructor initializes a newly created <code>Float</code> object so that it represents the 
result of narrowing <a href="5.doc.html#175672">(&#167;5.1.3)</a> the argument from type <code>double</code> to type <code>float</code>.
<p><a name="3684"></a>
<p><font size=+1><strong>20.9.8   </strong> <code>public <code><b>Float</b></code>(String s) throws NumberFormatException</code></font>
<p>
<a name="3753"></a>
This constructor initializes a newly created <code>Float</code> object so that it represents the 
floating-point value of type <code>float</code> represented by the string. The string is converted
to a <code>float</code> value in exactly the manner used by the <code>valueOf</code> method 
<a href="javalang.doc8.html#7256">(&#167;20.9.17)</a>.
<p><a name="1472"></a>
<p><font size=+1><strong>20.9.9   </strong> <code>public String <code><b>toString</b></code>()</code></font>
<p>
<a name="7314"></a>
The primitive <code>float</code> value represented by this <code>Float</code> object is converted to a 
string exactly as if by the method <code>toString</code> of one argument <a href="javalang.doc8.html#1466">(&#167;20.9.16)</a>.
<p><a name="3964"></a>
Overrides the <code>toString</code> method of <code>Object</code> <a href="javalang.doc1.html#1152">(&#167;20.1.2)</a>.<p>
<a name="1473"></a>
<p><font size=+1><strong>20.9.10   </strong> <code>public boolean <code><b>equals</b></code>(Object obj)</code></font>
<p>
<a name="4646"></a>
The result is <code>true</code> if and only if the argument is not <code>null</code> and is a <code>Float</code> object 
that represents the same <code>float</code> value as this <code>Float</code> object. For this purpose, two 
<code>float</code> values are considered to be the same if and only if the method 
<code>floatToIntBits</code> &#32;<a href="javalang.doc8.html#14423">(&#167;20.9.22)</a> returns the same <code>int</code> value when applied to each. 
Note that even though the <code>==</code> operator returns <code>false</code> if both operands are NaN, 
this <code>equals</code> method will return <code>true</code> if this <code>Float</code> object and the argument are 
both <code>Float</code> objects that represent NaN. On the other hand, even though the <code>==</code> 
operator returns <code>true</code> if one operand is positive zero and the other is negative 
zero, this <code>equals</code> method will return <code>false</code> if this <code>Float</code> object and the argument 
represent zeroes of different sign. This definition allows hashtables to operate 
properly.
<p><a name="3988"></a>
Overrides the <code>equals</code> method of <code>Object</code> <a href="javalang.doc1.html#14865">(&#167;20.1.3)</a>.<p>
<a name="1474"></a>
<p><font size=+1><strong>20.9.11   </strong> <code>public int <code><b>hashCode</b></code>()</code></font>
<p>
<a name="4722"></a>
The result is the integer bit representation, exactly as produced by the method 
<code>floatToIntBits</code> <a href="javalang.doc8.html#14423">(&#167;20.9.22)</a>, of the primitive <code>float</code> value represented by this 
<code>Float</code> object.
<p><a name="4054"></a>
Overrides the <code>hashCode</code> method of <code>Object</code> <a href="javalang.doc1.html#13784">(&#167;20.1.4)</a>.<p>
<a name="1475"></a>
<p><font size=+1><strong>20.9.12   </strong> <code>public int <code><b>intValue</b></code>()</code></font>
<p>
<a name="4551"></a>
The <code>float</code> value represented by this <code>Float</code> object is converted <a href="5.doc.html#175672">(&#167;5.1.3)</a> to type 
<code>int</code> and the result of the conversion is returned.
<p><a name="4284"></a>
Overrides the <code>intValue</code> method of <code>Number</code> <a href="javalang.doc5.html#3376">(&#167;20.6.1)</a>.<p>
<a name="1476"></a>
<p><font size=+1><strong>20.9.13   </strong> <code>public long <code><b>longValue</b></code>()</code></font>
<p>
<a name="4566"></a>
The <code>float</code> value represented by this <code>Float</code> object is converted <a href="5.doc.html#175672">(&#167;5.1.3)</a> to type 
<code>long</code> and the result of the conversion is returned.
<p><a name="4372"></a>
Overrides the <code>longValue</code> method of <code>Number</code> <a href="javalang.doc5.html#3434">(&#167;20.6.2)</a>.<p>
<a name="1477"></a>
<p><font size=+1><strong>20.9.14   </strong> <code>public float <code><b>floatValue</b></code>()</code></font>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -