📄 double.html
字号:
<BR> Returns true if this Double value is the special Not-a-Number (NaN) value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Double.html#isNaN(double)">isNaN</A></B>(double v)</CODE><BR> Returns true if the specified number is the special Not-a-Number (NaN) value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static double</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Double.html#longBitsToDouble(long)">longBitsToDouble</A></B>(long bits)</CODE><BR> Returns the double-float corresponding to a given bit represention.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Double.html#longValue()">longValue</A></B>()</CODE><BR> Returns the long value of this Double (by casting to a long).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static double</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Double.html#parseDouble(java.lang.String)">parseDouble</A></B>(<A HREF="../../java/lang/String.html">String</A> s)</CODE><BR> Returns a new double initialized to the value represented by the specified <code>String</code>, as performed by the <code>valueOf</code> method of class <code>Double</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> short</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Double.html#shortValue()">shortValue</A></B>()</CODE><BR> Returns the value of this Double as a short (by casting to a short).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Double.html#toString()">toString</A></B>()</CODE><BR> Returns a String representation of this Double object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Double.html#toString(double)">toString</A></B>(double d)</CODE><BR> Creates a string representation of the <code>double</code> argument.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/lang/Double.html">Double</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Double.html#valueOf(java.lang.String)">valueOf</A></B>(<A HREF="../../java/lang/String.html">String</A> s)</CODE><BR> Returns a new <code>Double</code> object initialized to the value represented by the specified string.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="POSITIVE_INFINITY"><!-- --></A><H3>POSITIVE_INFINITY</H3><PRE>public static final double <B>POSITIVE_INFINITY</B></PRE><DL><DD>The positive infinity of type <code>double</code>. It is equal to the value returned by <code>Double.longBitsToDouble(0x7ff0000000000000L)</code>.</DL><HR><A NAME="NEGATIVE_INFINITY"><!-- --></A><H3>NEGATIVE_INFINITY</H3><PRE>public static final double <B>NEGATIVE_INFINITY</B></PRE><DL><DD>The negative infinity of type <code>double</code>. It is equal to the value returned by <code>Double.longBitsToDouble(0xfff0000000000000L)</code>.</DL><HR><A NAME="NaN"><!-- --></A><H3>NaN</H3><PRE>public static final double <B>NaN</B></PRE><DL><DD>A Not-a-Number (NaN) value of type <code>double</code>. It is equal to the value returned by <code>Double.longBitsToDouble(0x7ff8000000000000L)</code>.</DL><HR><A NAME="MAX_VALUE"><!-- --></A><H3>MAX_VALUE</H3><PRE>public static final double <B>MAX_VALUE</B></PRE><DL><DD>The largest positive finite value of type <code>double</code>. It is equal to the returned by: <blockquote><pre> <code>Double.longBitsToDouble(0x7fefffffffffffffL)</code> </pre></blockquote></DL><HR><A NAME="MIN_VALUE"><!-- --></A><H3>MIN_VALUE</H3><PRE>public static final double <B>MIN_VALUE</B></PRE><DL><DD>The smallest positive value of type <code>double</code>. It is equal to the value returned by <code>Double.longBitsToDouble(0x1L)</code>.</DL><HR><A NAME="TYPE"><!-- --></A><H3>TYPE</H3><PRE>public static final <A HREF="../../java/lang/Class.html">Class</A> <B>TYPE</B></PRE><DL><DD>The Class object representing the primitive type double.<DD><DL><DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Double(double)"><!-- --></A><H3>Double</H3><PRE>public <B>Double</B>(double value)</PRE><DL><DD>Constructs a newly allocated <code>Double</code> object that represents the primitive <code>double</code> argument.<DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - the value to be represented by the <code>Double</code>.</DL></DD></DL><HR><A NAME="Double(java.lang.String)"><!-- --></A><H3>Double</H3><PRE>public <B>Double</B>(<A HREF="../../java/lang/String.html">String</A> s) throws <A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></PRE><DL><DD>Constructs a newly allocated <code>Double</code> object that represents the floating- point value of type <code>double</code> represented by the string. The string is converted to a <code>double</code> value as if by the <code>valueOf</code> method.<DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - a string to be converted to a <code>Double</code>.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></CODE> - if the string does not contain a parsable number.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Double.html#valueOf(java.lang.String)"><CODE>valueOf(java.lang.String)</CODE></A></DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="toString(double)"><!-- --></A><H3>toString</H3><PRE>public static <A HREF="../../java/lang/String.html">String</A> <B>toString</B>(double d)</PRE><DL><DD>Creates a string representation of the <code>double</code> argument. All characters mentioned below are ASCII characters. <ul> <li>If the argument is NaN, the result is the string "NaN". <li>Otherwise, the result is a string that represents the sign and magnitude (absolute value) of the argument. If the sign is negative, the first character of the result is '<code>-</code>' ('<code>-</code>'); if the sign is positive, no sign character appears in the result. As for the magnitude <i>m</i>: <li>If <i>m</i> is infinity, it is represented by the characters <code>"Infinity"</code>; thus, positive infinity produces the result <code>"Infinity"</code> and negative infinity produces the result <code>"-Infinity"</code>. <li>If <i>m</i> is zero, it is represented by the characters <code>"0.0"</code>; thus, negative zero produces the result <code>"-0.0"</code> and positive zero produces the result <code>"0.0"</code>. <li>If <i>m</i> is greater than or equal to 10<sup>-3</sup> but less than 10<sup>7</sup>, then it is represented as the integer part of <i>m</i>, in decimal form with no leading zeroes, followed by <code>'.'</code> (<code>.</code>), followed by one or more decimal digits representing the fractional part of <i>m</i>. <li>If <i>m</i> is less than 10<sup>-3</sup> or not less than 10<sup>7</sup>, then it is represented in so-called "computerized scientific notation." Let <i>n</i> be the unique integer such that 10<sup>n</sup><=<i>m</i><10<sup>n+1</sup>; then let <i>a</i> be the mathematically exact quotient of <i>m</i> and 10<sup>n</sup> so that 1<=<i>a</i><10. The magnitude is then represented as the integer part of <i>a</i>, as a single decimal digit, followed by <code>'.'</code> (<code>.</code>), followed by decimal digits representing the fractional part of <i>a</i>, followed by the letter <code>'E'</code> (<code>E</code>), followed by a representation of <i>n</i> as a decimal integer, as produced by the method <A HREF="../../java/lang/Integer.html#toString(int)"><CODE>Integer.toString(int)</CODE></A>. </ul><p> How many digits must be printed for the fractional part of <i>m</i> or <i>a</i>? There must be at least one digit to represent the fractional part, and beyond that as many, but only as many, more digits as are needed to uniquely distinguish the argument value from adjacent values of type <code>double</code>. That is, suppose that <i>x</i> is the exact mathematical value represented by the decimal representation produced by this method for a finite nonzero argument <i>d</i>. Then <i>d</i> must be the <code>double</code> value nearest to <i>x</i>; or if two <code>double</code> values are equally close to <i>x</i>, then <i>d</i> must be one of them and the least significant bit of the significand of <i>d</i> must be <code>0</code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>d</CODE> - the <code>double</code> to be converted.<DT><B>Returns:</B><DD>a string representation of the argument.</DL></DD></DL><HR><A NAME="valueOf(java.lang.String)"><!-- --></A><H3>valueOf</H3><PRE>public static <A HREF="../../java/lang/Double.html">Double</A> <B>valueOf</B>(<A HREF="../../java/lang/String.html">String</A> s) throws <A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></PRE><DL><DD>Returns a new <code>Double</code> object initialized to the value represented by the specified string. The string <code>s</code> is interpreted as the representation of a floating-point value and a <code>Double</code> object representing that value is created and returned. <p> If <code>s</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown. <p> Leading and trailing whitespace characters in s are ignored. The rest of <code>s</code> should constitute a <i>FloatValue</i> as described by the lexical rule: <blockquote><pre><i> FloatValue: Sign<sub>opt</sub> FloatingPointLiteral </i></pre></blockquote> where <i>Sign</i> and <i>FloatingPointLiteral</i> are as defined in
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -