📄 math.html
字号:
<BR> Returns the smaller of two <code>float</code> values.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Math.html#min(int, int)">min</A></B>(int a, int b)</CODE><BR> Returns the smaller of two <code>int</code> values.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static long</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Math.html#min(long, long)">min</A></B>(long a, long b)</CODE><BR> Returns the smaller of two <code>long</code> values.</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/Math.html#pow(double, double)">pow</A></B>(double a, double b)</CODE><BR> Returns of value of the first argument raised to the power of the second argument.</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/Math.html#random()">random</A></B>()</CODE><BR> Returns a <code>double</code> value with a positive sign, greater than or equal to <code>0.0</code> and less than <code>1.0</code>.</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/Math.html#rint(double)">rint</A></B>(double a)</CODE><BR> Returns the <code>double</code> value that is closest in value to <code>a</code> and is equal to a mathematical integer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static long</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Math.html#round(double)">round</A></B>(double a)</CODE><BR> Returns the closest <code>long</code> to the argument.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/Math.html#round(float)">round</A></B>(float a)</CODE><BR> Returns the closest <code>int</code> to the argument.</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/Math.html#sin(double)">sin</A></B>(double a)</CODE><BR> Returns the trigonometric sine of an angle.</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/Math.html#sqrt(double)">sqrt</A></B>(double a)</CODE><BR> Returns the correctly rounded positive square root of a <code>double</code> 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/Math.html#tan(double)">tan</A></B>(double a)</CODE><BR> Returns the trigonometric tangent of an angle.</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/Math.html#toDegrees(double)">toDegrees</A></B>(double angrad)</CODE><BR> Converts an angle measured in radians to the equivalent angle measured in degrees.</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/Math.html#toRadians(double)">toRadians</A></B>(double angdeg)</CODE><BR> Converts an angle measured in degrees to the equivalent angle measured in radians.</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#equals(java.lang.Object)">equals</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#hashCode()">hashCode</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#toString()">toString</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="E"><!-- --></A><H3>E</H3><PRE>public static final double <B>E</B></PRE><DL><DD>The <code>double</code> value that is closer than any other to <code>e</code>, the base of the natural logarithms.</DL><HR><A NAME="PI"><!-- --></A><H3>PI</H3><PRE>public static final double <B>PI</B></PRE><DL><DD>The <code>double</code> value that is closer than any other to <i>pi</i>, the ratio of the circumference of a circle to its diameter.</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ 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="sin(double)"><!-- --></A><H3>sin</H3><PRE>public static double <B>sin</B>(double a)</PRE><DL><DD>Returns the trigonometric sine of an angle. Special cases: <ul><li>If the argument is NaN or an infinity, then the result is NaN. <li>If the argument is positive zero, then the result is positive zero; if the argument is negative zero, then the result is negative zero.</ul> <p> A result must be within 1 ulp of the correctly rounded result. Results must be semi-monotonic.<DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - an angle, in radians.<DT><B>Returns:</B><DD>the sine of the argument.</DL></DD></DL><HR><A NAME="cos(double)"><!-- --></A><H3>cos</H3><PRE>public static double <B>cos</B>(double a)</PRE><DL><DD>Returns the trigonometric cosine of an angle. Special case: <ul><li>If the argument is NaN or an infinity, then the result is NaN.</ul> <p> A result must be within 1 ulp of the correctly rounded result. Results must be semi-monotonic.<DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - an angle, in radians.<DT><B>Returns:</B><DD>the cosine of the argument.</DL></DD></DL><HR><A NAME="tan(double)"><!-- --></A><H3>tan</H3><PRE>public static double <B>tan</B>(double a)</PRE><DL><DD>Returns the trigonometric tangent of an angle. Special cases: <ul><li>If the argument is NaN or an infinity, then the result is NaN. <li>If the argument is positive zero, then the result is positive zero; if the argument is negative zero, then the result is negative zero</ul> <p> A result must be within 1 ulp of the correctly rounded result. Results must be semi-monotonic.<DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - an angle, in radians.<DT><B>Returns:</B><DD>the tangent of the argument.</DL></DD></DL><HR><A NAME="asin(double)"><!-- --></A><H3>asin</H3><PRE>public static double <B>asin</B>(double a)</PRE><DL><DD>Returns the arc sine of an angle, in the range of -<i>pi</i>/2 through <i>pi</i>/2. Special cases: <ul><li>If the argument is NaN or its absolute value is greater than 1, then the result is NaN. <li>If the argument is positive zero, then the result is positive zero; if the argument is negative zero, then the result is negative zero.</ul> <p> A result must be within 1 ulp of the correctly rounded result. Results must be semi-monotonic.<DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - the <code>double</code> value whose arc sine is to be returned.<DT><B>Returns:</B><DD>the arc sine of the argument.</DL></DD></DL><HR><A NAME="acos(double)"><!-- --></A><H3>acos</H3><PRE>public static double <B>acos</B>(double a)</PRE><DL><DD>Returns the arc cosine of an angle, in the range of 0.0 through <i>pi</i>. Special case: <ul><li>If the argument is NaN or its absolute value is greater than 1, then the result is NaN.</ul> <p> A result must be within 1 ulp of the correctly rounded result. Results must be semi-monotonic.<DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - the <code>double</code> value whose arc cosine is to be returned.<DT><B>Returns:</B><DD>the arc cosine of the argument.</DL></DD></DL><HR><A NAME="atan(double)"><!-- --></A><H3>atan</H3><PRE>public static double <B>atan</B>(double a)</PRE><DL><DD>Returns the arc tangent of an angle, in the range of -<i>pi</i>/2 through <i>pi</i>/2. Special cases: <ul><li>If the argument is NaN, then the result is NaN. <li>If the argument is positive zero, then the result is positive zero; if the argument is negative zero, then the result is negative zero.</ul> <p> A result must be within 1 ulp of the correctly rounded result. Results must be semi-monotonic.<DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - the <code>double</code> value whose arc tangent is to be returned.<DT><B>Returns:</B><DD>the arc tangent of the argument.</DL></DD></DL><HR><A NAME="toRadians(double)"><!-- --></A><H3>toRadians</H3><PRE>public static double <B>toRadians</B>(double angdeg)</PRE><DL><DD>Converts an angle measured in degrees to the equivalent angle measured in radians.<DD><DL><DT><B>Parameters:</B><DD><CODE>angdeg</CODE> - an angle, in degrees<DT><B>Returns:</B><DD>the measurement of the angle <code>angdeg</code> in radians.<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="toDegrees(double)"><!-- --></A><H3>toDegrees</H3><PRE>public static double <B>toDegrees</B>(double angrad)</PRE><DL><DD>Converts an angle measured in radians to the equivalent angle measured in degrees.<DD><DL><DT><B>Parameters:</B><DD><CODE>angrad</CODE> - an angle, in radians<DT><B>Returns:</B><DD>the measurement of the angle <code>angrad</code> in degrees.<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="exp(double)"><!-- --></A><H3>exp</H3><PRE>public static double <B>exp</B>(double a)</PRE><DL><DD>Returns the exponential number <i>e</i> (i.e., 2.718...) raised to the power of a <code>double</code> value. Special cases:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -