blob: 6755f0278d0ad978162da17f79491fb18fb222f9 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (19) -->
<title>MathFunctions (Apache SIS 1.3 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.sis.math, class: MathFunctions">
<meta name="generator" content="javadoc/ClassWriterImpl">
<meta name="keywords" content="org.apache.sis.math.MathFunctions class">
<meta name="keywords" content="SQRT_2">
<meta name="keywords" content="LOG10_2">
<meta name="keywords" content="MIN_NAN_ORDINAL">
<meta name="keywords" content="MAX_NAN_ORDINAL">
<meta name="keywords" content="HIGHEST_SUPPORTED_PRIME_NUMBER">
<meta name="keywords" content="average()">
<meta name="keywords" content="truncate()">
<meta name="keywords" content="magnitude()">
<meta name="keywords" content="getExponent()">
<meta name="keywords" content="pow()">
<meta name="keywords" content="pow10()">
<meta name="keywords" content="asinh()">
<meta name="keywords" content="acosh()">
<meta name="keywords" content="atanh()">
<meta name="keywords" content="isPositive()">
<meta name="keywords" content="isPositiveZero()">
<meta name="keywords" content="isNegative()">
<meta name="keywords" content="isNegativeZero()">
<meta name="keywords" content="isSameSign()">
<meta name="keywords" content="xorSign()">
<meta name="keywords" content="epsilonEqual()">
<meta name="keywords" content="toNanFloat()">
<meta name="keywords" content="toNanOrdinal()">
<meta name="keywords" content="quadrupleToDouble()">
<meta name="keywords" content="nextPrimeNumber()">
<meta name="keywords" content="divisors()">
<meta name="keywords" content="commonDivisors()">
<meta name="keywords" content="polynomialRoots()">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../sis.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var pathtoroot = "../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span></button>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/MathFunctions.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html#class">Help</a></li>
</ul>
<ul class="sub-nav-list-small">
<li>
<p>Summary:</p>
<ul>
<li>Nested</li>
<li><a href="#field-summary">Field</a></li>
<li>Constr</li>
<li><a href="#method-summary">Method</a></li>
</ul>
</li>
<li>
<p>Detail:</p>
<ul>
<li><a href="#field-detail">Field</a></li>
<li>Constr</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</li>
</ul>
</div>
<div class="sub-nav">
<div id="navbar-sub-list">
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li><a href="#field-detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><a href="../../../../search.html">SEARCH</a>
<input type="text" id="search-input" disabled placeholder="Search">
<input type="reset" id="reset-button" disabled value="reset">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.sis.math</a></div>
<h1 title="Class MathFunctions" class="title">Class MathFunctions</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
<div class="inheritance"><a href="../util/Static.html" title="class in org.apache.sis.util">Static</a>
<div class="inheritance">MathFunctions</div>
</div>
</div>
<section class="class-description" id="class-description">
<hr>
<div class="type-signature"><span class="modifiers">public final class </span><span class="element-name type-name-label">MathFunctions</span>
<span class="extends-implements">extends <a href="../util/Static.html" title="class in org.apache.sis.util">Static</a></span></div>
<div class="block">Simple mathematical functions in addition to the ones provided in <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html" title="class or interface in java.lang" class="external-link"><code>Math</code></a>.
Some methods in this class are very similar to the standard <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html" title="class or interface in java.lang" class="external-link"><code>Math</code></a> methods
or could be implemented with straightforward formulas.
However, the methods in this class put an emphasis on:
<ul>
<li>Rounding errors:
<a href="#magnitude(double...)"><code>magnitude</code></a>,
<a href="#pow10(double)"><code>pow10</code></a>.</li>
<li>Distinguishing positive zero from negative zero:
<a href="#isPositive(double)"><code>is­Positive</code></a>,
<a href="#isNegative(double)"><code>is­Negative</code></a>,
<a href="#isSameSign(double,double)"><code>is­Same­Sign</code></a>,
<a href="#xorSign(double,double)"><code>xor­Sign</code></a>.</li>
<li>Distinguishing the different kinds of NaN numbers:
<a href="#toNanFloat(int)"><code>to­Nan­Float</code></a>,
<a href="#toNanOrdinal(float)"><code>to­Nan­Ordinal</code></a>.</li>
</ul>
Some additional functions not found in <code>Math</code> are:
<a href="#atanh(double)"><code>atanh</code></a>,
<a href="#nextPrimeNumber(int)"><code>next­Prime­Number</code></a>.</div>
<dl class="notes">
<dt>Since:</dt>
<dd>0.3</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="DecimalFunctions.html" title="class in org.apache.sis.math"><code>Decimal­Functions</code></a></li>
<li><a href="../util/Numbers.html" title="class in org.apache.sis.util"><code>Numbers</code></a></li>
</ul>
</dd>
<p><font size="-1">Defined in the <code>sis-utility</code> module</font></p>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<section class="field-summary" id="field-summary">
<h2>Field Summary</h2>
<div class="caption"><span>Fields</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Field</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>static final int</code></div>
<div class="col-second even-row-color"><code><a href="#HIGHEST_SUPPORTED_PRIME_NUMBER" class="member-name-link">HIGHEST_SUPPORTED_PRIME_NUMBER</a></code></div>
<div class="col-last even-row-color">
<div class="block">The highest prime number supported by the <a href="#nextPrimeNumber(int)"><code>next­Prime­Number(int)</code></a> method.</div>
</div>
<div class="col-first odd-row-color"><code>static final double</code></div>
<div class="col-second odd-row-color"><code><a href="#LOG10_2" class="member-name-link">LOG10_2</a></code></div>
<div class="col-last odd-row-color">
<div class="block">The logarithm of 2 in base 10, which is approximated by 0.3010299956639812.</div>
</div>
<div class="col-first even-row-color"><code>static final int</code></div>
<div class="col-second even-row-color"><code><a href="#MAX_NAN_ORDINAL" class="member-name-link">MAX_NAN_ORDINAL</a></code></div>
<div class="col-last even-row-color">
<div class="block">The maximal ordinal value for <code>Na­N</code> numbers created by <a href="#toNanFloat(int)"><code>to­Nan­Float(int)</code></a>.</div>
</div>
<div class="col-first odd-row-color"><code>static final int</code></div>
<div class="col-second odd-row-color"><code><a href="#MIN_NAN_ORDINAL" class="member-name-link">MIN_NAN_ORDINAL</a></code></div>
<div class="col-last odd-row-color">
<div class="block">The minimal ordinal value for <code>Na­N</code> numbers created by <a href="#toNanFloat(int)"><code>to­Nan­Float(int)</code></a>.</div>
</div>
<div class="col-first even-row-color"><code>static final double</code></div>
<div class="col-second even-row-color"><code><a href="#SQRT_2" class="member-name-link">SQRT_2</a></code></div>
<div class="col-last even-row-color">
<div class="block">The square root of 2, which is approximated by 1.4142135623730951.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#acosh(double)" class="member-name-link">acosh</a><wbr>(double&nbsp;x)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the inverse hyperbolic cosine of the given value.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#asinh(double)" class="member-name-link">asinh</a><wbr>(double&nbsp;x)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the inverse hyperbolic sine of the given value.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#atanh(double)" class="member-name-link">atanh</a><wbr>(double&nbsp;x)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the inverse hyperbolic tangent of the given value.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#average(long,long)" class="member-name-link">average</a><wbr>(long&nbsp;x,
long&nbsp;y)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the averages of two signed integers without overflow.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static int[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#commonDivisors(int...)" class="member-name-link">common­Divisors</a><wbr>(int...&nbsp;numbers)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the positive divisors which are common to all the specified numbers.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static int[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#divisors(int)" class="member-name-link">divisors</a><wbr>(int&nbsp;number)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the divisors of the specified number as positive integers.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#epsilonEqual(double,double,double)" class="member-name-link">epsilon­Equal</a><wbr>(double&nbsp;v1,
double&nbsp;v2,
double&nbsp;ε)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if the given values are <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equal</a>
or if their difference is not greater than the given threshold.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#epsilonEqual(float,float,float)" class="member-name-link">epsilon­Equal</a><wbr>(float&nbsp;v1,
float&nbsp;v2,
float&nbsp;ε)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if the given values are <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equal</a>
or if their difference is not greater than the given threshold.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getExponent(double)" class="member-name-link">get­Exponent</a><wbr>(double&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the unbiased exponent used in the representation of a <code>double</code>, with correction for
sub-normal numbers.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#isNegative(double)" class="member-name-link">is­Negative</a><wbr>(double&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if the given value is negative, <em>including</em> negative zero.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#isNegativeZero(double)" class="member-name-link">is­Negative­Zero</a><wbr>(double&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if the given value is the negative zero (<code>-0.0</code>).</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#isPositive(double)" class="member-name-link">is­Positive</a><wbr>(double&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if the given value is positive, <em>excluding</em> negative zero.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#isPositiveZero(double)" class="member-name-link">is­Positive­Zero</a><wbr>(double&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if the given value is the positive zero (<code>+0.0</code>).</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#isSameSign(double,double)" class="member-name-link">is­Same­Sign</a><wbr>(double&nbsp;v1,
double&nbsp;v2)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if the given values have the same sign, differentiating positive
and negative zeros.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#magnitude(double...)" class="member-name-link">magnitude</a><wbr>(double...&nbsp;vector)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the magnitude of the given vector.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#nextPrimeNumber(int)" class="member-name-link">next­Prime­Number</a><wbr>(int&nbsp;number)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the first prime number equals or greater than the given value.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#polynomialRoots(double...)" class="member-name-link">polynomial­Roots</a><wbr>(double...&nbsp;coefficients)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the real (non-complex) roots of a polynomial equation having the given coefficients.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static long</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#pow(long,int)" class="member-name-link">pow</a><wbr>(long&nbsp;base,
int&nbsp;exponent)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the result of <code>base</code> argument raised to the power given by <code>exponent</code> argument.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#pow10(double)" class="member-name-link">pow10</a><wbr>(double&nbsp;x)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes 10 raised to the power of <var>x</var>.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#pow10(int)" class="member-name-link">pow10</a><wbr>(int&nbsp;x)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes 10 raised to the power of <var>x</var>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#quadrupleToDouble(long,long)" class="member-name-link">quadruple­To­Double</a><wbr>(long&nbsp;l0,
long&nbsp;l1)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Converts two long bits values containing a IEEE 754 quadruple precision floating point number
to a double precision floating point number.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static float</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#toNanFloat(int)" class="member-name-link">to­Nan­Float</a><wbr>(int&nbsp;ordinal)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html#isNaN(float)" title="class or interface in java.lang" class="external-link">NaN</a> number for the specified ordinal value.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#toNanOrdinal(float)" class="member-name-link">to­Nan­Ordinal</a><wbr>(float&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the ordinal value of the given NaN number.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#truncate(double)" class="member-name-link">truncate</a><wbr>(double&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Truncates the given value toward zero.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#xorSign(double,double)" class="member-name-link">xor­Sign</a><wbr>(double&nbsp;value,
double&nbsp;sign)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the first floating-point argument with the sign reversed if the second floating-point
argument is negative.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-Object">Methods inherited from class&nbsp;<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">get­Class</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hash­Code</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notify­All</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">to­String</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ FIELD DETAIL =========== -->
<li>
<section class="field-details" id="field-detail">
<h2>Field Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="SQRT_2">
<h3>SQRT_2</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">SQRT_2</span></div>
<div class="block">The square root of 2, which is approximated by 1.4142135623730951.</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#sqrt(double)" title="class or interface in java.lang" class="external-link"><code>Math​.sqrt(double)</code></a></li>
<li><a href="../../../../constant-values.html#org.apache.sis.math.MathFunctions.SQRT_2">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="LOG10_2">
<h3>LOG10_2</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">LOG10_2</span></div>
<div class="block">The logarithm of 2 in base 10, which is approximated by 0.3010299956639812.
This constant is useful for converting a power of 2 to a power of 10 as below:
<blockquote><pre><font color="green">double</font> exp10 = exp2 * LOG10_2;</pre></blockquote></div>
<dl class="notes">
<dt>Since:</dt>
<dd>0.4</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#log10(double)" title="class or interface in java.lang" class="external-link"><code>Math​.log10(double)</code></a></li>
<li><a href="#getExponent(double)"><code>get­Exponent(double)</code></a></li>
<li><a href="../../../../constant-values.html#org.apache.sis.math.MathFunctions.LOG10_2">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="MIN_NAN_ORDINAL">
<h3>MIN_NAN_ORDINAL</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">MIN_NAN_ORDINAL</span></div>
<div class="block">The minimal ordinal value for <code>Na­N</code> numbers created by <a href="#toNanFloat(int)"><code>to­Nan­Float(int)</code></a>.
The current value is -2097152.</div>
<dl class="notes">
<dt>Since:</dt>
<dd>1.0</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../../../../constant-values.html#org.apache.sis.math.MathFunctions.MIN_NAN_ORDINAL">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="MAX_NAN_ORDINAL">
<h3>MAX_NAN_ORDINAL</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">MAX_NAN_ORDINAL</span></div>
<div class="block">The maximal ordinal value for <code>Na­N</code> numbers created by <a href="#toNanFloat(int)"><code>to­Nan­Float(int)</code></a>.
The current value is 2097151.</div>
<dl class="notes">
<dt>Since:</dt>
<dd>1.0</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../../../../constant-values.html#org.apache.sis.math.MathFunctions.MAX_NAN_ORDINAL">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="HIGHEST_SUPPORTED_PRIME_NUMBER">
<h3>HIGHEST_SUPPORTED_PRIME_NUMBER</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">HIGHEST_SUPPORTED_PRIME_NUMBER</span></div>
<div class="block">The highest prime number supported by the <a href="#nextPrimeNumber(int)"><code>next­Prime­Number(int)</code></a> method.
In the current implementation, this value is 65521. However, this limit may
change in any future Apache SIS version.
<div class="note"><b>Note:</b>
The current value is the highest prime number representable as an unsigned 16 bits integer.
This is enough for current needs because 16 bits prime numbers are sufficient for finding
the divisors of any 32 bits integers.</div></div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#nextPrimeNumber(int)"><code>next­Prime­Number(int)</code></a></li>
<li><a href="../../../../constant-values.html#org.apache.sis.math.MathFunctions.HIGHEST_SUPPORTED_PRIME_NUMBER">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="average(long,long)">
<h3>average</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">average</span><wbr><span class="parameters">(long&nbsp;x,
long&nbsp;y)</span></div>
<div class="block">Computes the averages of two signed integers without overflow. The calculation is performed with
<code>long</code> arithmetic before to convert the result to the <code>double</code> floating point number.
This function may be more accurate than the classical (x+y)/2 formula when <var>x</var> and/or
<var>y</var> are very large, because it will avoid the lost of last digits before averaging.
If exactly one of <var>x</var> and <var>y</var> is odd, the result will contain the 0.5 fraction digit.
<div class="note"><b>Source:</b> this function is adapted from
<a href="http://aggregate.org/MAGIC/#Average%20of%20Integers">The Aggregate Magic Algorithms</a>
from University of Kentucky.</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>x</code> - the first value to average.</dd>
<dd><code>y</code> - the second value to average.</dd>
<dt>Returns:</dt>
<dd>average of given values without integer overflow.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="truncate(double)">
<h3>truncate</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">truncate</span><wbr><span class="parameters">(double&nbsp;value)</span></div>
<div class="block">Truncates the given value toward zero. Invoking this method is equivalent to invoking
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#floor(double)" title="class or interface in java.lang" class="external-link"><code>Math​.floor(double)</code></a> if the value is positive, or <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#ceil(double)" title="class or interface in java.lang" class="external-link"><code>Math​.ceil(double)</code></a> if
the value is negative.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - the value to truncate.</dd>
<dt>Returns:</dt>
<dd>the largest in magnitude (further from zero) integer value which is equal
or less in magnitude than the given value.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="magnitude(double...)">
<h3>magnitude</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">magnitude</span><wbr><span class="parameters">(double...&nbsp;vector)</span></div>
<div class="block">Returns the magnitude of the given vector. This is defined by:
<blockquote><pre>sqrt(vector[0]² + vector[1]² + … + vector[length-1]²)</pre></blockquote>
If the given vector contains a NaN value, then the result is NaN.
<h4>Implementation note</h4>
In the special case where only one element is different than zero, this method
returns directly the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#abs(double)" title="class or interface in java.lang" class="external-link">absolute value</a> of that element
without computing <code>sqrt(v²)</code>, in order to avoid rounding error. This special case
has been implemented because this method is often invoked for computing the length of
offset vectors,
typically aligned with the axes of a <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/cs/CartesianCS.html" title="class or interface in org.opengis.referencing.cs" class="external-link">Cartesian coordinate system</a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>vector</code> - the vector for which to compute the magnitude.</dd>
<dt>Returns:</dt>
<dd>the magnitude of the given vector as a positive number, of NaN.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#hypot(double,double)" title="class or interface in java.lang" class="external-link"><code>Math​.hypot(double, double)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getExponent(double)">
<h3>getExponent</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getExponent</span><wbr><span class="parameters">(double&nbsp;value)</span></div>
<div class="block">Returns the unbiased exponent used in the representation of a <code>double</code>, with correction for
sub-normal numbers. This method is related to <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#getExponent(double)" title="class or interface in java.lang" class="external-link"><code>Math​.get­Exponent(double)</code></a> in the following ways:
<ul>
<li>For NaN and all values equal or greater than <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#MIN_NORMAL" title="class or interface in java.lang" class="external-link"><code>Double​.MIN_NORMAL</code></a> in magnitude (including
infinities), this method returns results that are identical to <code>Math​.get­Exponent(double)</code>.</li>
<li>For values smaller than <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#MIN_NORMAL" title="class or interface in java.lang" class="external-link"><code>Double​.MIN_NORMAL</code></a> in magnitude (including zero), the correction
for sub-normal numbers results in return values smaller than what <code>Math​.get­Exponent(double)</code>
would return.</li>
</ul>
Special cases:
<ul>
<li>If the argument is NaN or infinite, then the result is <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#MAX_EXPONENT" title="class or interface in java.lang" class="external-link"><code>Double​.MAX_EXPONENT</code></a> + 1.</li>
<li>If the argument is <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#MAX_VALUE" title="class or interface in java.lang" class="external-link"><code>Double​.MAX_VALUE</code></a>, then the result is <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#MAX_EXPONENT" title="class or interface in java.lang" class="external-link">1023</a>.</li>
<li>If the argument is <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#MIN_NORMAL" title="class or interface in java.lang" class="external-link"><code>Double​.MIN_NORMAL</code></a>, then the result is <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#MIN_EXPONENT" title="class or interface in java.lang" class="external-link">-1022</a>.</li>
<li>If the argument is <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#MIN_VALUE" title="class or interface in java.lang" class="external-link"><code>Double​.MIN_VALUE</code></a>, then the result is -1074.</li>
<li>If the argument is zero, then the result is -1075.</li>
</ul>
<h4>Identities</h4>
For any <var>p</var> values in the [-1075 … 1024] range and <var>value</var> = 2<sup>p</sup>:
<ul>
<li><code>get­Exponent(Math​.scalb(1.0, p)) == p</code></li>
<li><code>Math​.scalb(1.0, get­Exponent(value)) == value</code></li>
<li><code>Math​.floor(<a href="#LOG10_2">LOG10_2</a> * get­Exponent(value)) == Math​.floor(Math​.log10(value))</code></li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - the value for which to get the exponent.</dd>
<dt>Returns:</dt>
<dd>the unbiased exponent, corrected for sub-normal numbers if needed.
Values will be in the [-1075 … 1024] range, inclusive.</dd>
<dt>Since:</dt>
<dd>0.4</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#getExponent(double)" title="class or interface in java.lang" class="external-link"><code>Math​.get­Exponent(double)</code></a></li>
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#scalb(double,int)" title="class or interface in java.lang" class="external-link"><code>Math​.scalb(double, int)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="pow(long,int)">
<h3>pow</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">pow</span><wbr><span class="parameters">(long&nbsp;base,
int&nbsp;exponent)</span></div>
<div class="block">Computes the result of <code>base</code> argument raised to the power given by <code>exponent</code> argument.
This method computes the same value than <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#pow(double,double)" title="class or interface in java.lang" class="external-link"><code>Math​.pow(double, double)</code></a> but using only integer arithmetic.
The result must be representable as a 64 bits integers (<code>long</code> primitive type),
otherwise an <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link"><code>Arithmetic­Exception</code></a> is thrown. The result is guaranteed exact,
in contrast to results represented as <code>double</code> floating point values
which may be approximate for magnitudes greater than 2<sup>52</sup>.
This method may also be faster.
<div class="note"><b>Implementation note:</b> this method uses
<a href="https://en.wikipedia.org/wiki/Exponentiation_by_squaring">exponentiation by squaring</a> technic.</div>
The type of the <code>base</code> argument is <code>long</code> for convenience, since this method is used in contexts
where relatively large integers are handled. However, any value greater than the capacity of <code>int</code> type
is guaranteed to fail with <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link"><code>Arithmetic­Exception</code></a> unless <code>exponent</code> is 0 or 1.
Likewise any <code>exponent</code> value greater than 62 is guaranteed to fail unless <code>base</code> is 0 or 1.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>base</code> - the value to raise to an exponent.</dd>
<dd><code>exponent</code> - the exponent, as zero or positive number.</dd>
<dt>Returns:</dt>
<dd>the value <var>base</var><sup><var>exponent</var></sup> as a 64 bits integer.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if the given exponent is negative, or if the result overflow integer arithmetic.</dd>
<dt>Since:</dt>
<dd>1.0</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#pow(double,double)" title="class or interface in java.lang" class="external-link"><code>Math​.pow(double, double)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="pow10(int)">
<h3>pow10</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">pow10</span><wbr><span class="parameters">(int&nbsp;x)</span></div>
<div class="block">Computes 10 raised to the power of <var>x</var>. This method is faster and slightly more accurate
than invoking <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#pow(double,double)" title="class or interface in java.lang" class="external-link">Math​.pow</a>(10, x)</code>.
<div class="note"><b>Note:</b>
This method has been defined because the standard <code>Math​.pow(10, x)</code> method does not always return
the closest IEEE floating point representation. Slight departures (1 or 2 ULP) are often allowed in math
functions for performance reasons. The most accurate calculations are usually not necessary, but the base
10 is a special case since it is used for scaling axes or formatting human-readable output.</div>
Special cases:
<ul>
<li>If <var>x</var> is equal or lower than -324, then the result is 0.</li>
<li>If <var>x</var> is equal or greater than 309, then the result is <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#POSITIVE_INFINITY" title="class or interface in java.lang" class="external-link">positive infinity</a>.</li>
<li>If <var>x</var> is in the [0 … 18] range inclusive, then the result is exact.</li>
<li>For all other <var>x</var> values, the result is the closest IEEE 754 approximation.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>x</code> - the exponent.</dd>
<dt>Returns:</dt>
<dd>10 raised to the given exponent.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#pow10(double)"><code>pow10(double)</code></a></li>
<li><a href="#LOG10_2"><code>LOG10_2</code></a></li>
<li><a href="DecimalFunctions.html" title="class in org.apache.sis.math"><code>Decimal­Functions</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="pow10(double)">
<h3>pow10</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">pow10</span><wbr><span class="parameters">(double&nbsp;x)</span></div>
<div class="block">Computes 10 raised to the power of <var>x</var>. Invoking this method is equivalent to invoking
<code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#pow(double,double)" title="class or interface in java.lang" class="external-link">Math​.pow</a>(10, x)</code>, but is slightly more accurate
in the special case where the given argument is an integer.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>x</code> - the exponent.</dd>
<dt>Returns:</dt>
<dd>10 raised to the given exponent.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="#pow10(int)"><code>pow10(int)</code></a></li>
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#pow(double,double)" title="class or interface in java.lang" class="external-link"><code>Math​.pow(double, double)</code></a></li>
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#log10(double)" title="class or interface in java.lang" class="external-link"><code>Math​.log10(double)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="asinh(double)">
<h3>asinh</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">asinh</span><wbr><span class="parameters">(double&nbsp;x)</span></div>
<div class="block">Returns the inverse hyperbolic sine of the given value.
This is the inverse of the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#sinh(double)" title="class or interface in java.lang" class="external-link"><code>Math​.sinh(double)</code></a> method.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>x</code> - the value for which to compute the inverse hyperbolic sine.</dd>
<dt>Returns:</dt>
<dd>the inverse hyperbolic sine of the given value.</dd>
<dt>Since:</dt>
<dd>0.6</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#sinh(double)" title="class or interface in java.lang" class="external-link"><code>Math​.sinh(double)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="acosh(double)">
<h3>acosh</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">acosh</span><wbr><span class="parameters">(double&nbsp;x)</span></div>
<div class="block">Returns the inverse hyperbolic cosine of the given value.
This is the inverse of the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#cosh(double)" title="class or interface in java.lang" class="external-link"><code>Math​.cosh(double)</code></a> method.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>x</code> - the value for which to compute the inverse hyperbolic cosine.</dd>
<dt>Returns:</dt>
<dd>the inverse hyperbolic cosine of the given value.</dd>
<dt>Since:</dt>
<dd>0.6</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#cosh(double)" title="class or interface in java.lang" class="external-link"><code>Math​.cosh(double)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="atanh(double)">
<h3>atanh</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">atanh</span><wbr><span class="parameters">(double&nbsp;x)</span></div>
<div class="block">Returns the inverse hyperbolic tangent of the given value.
This is the inverse of the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#tanh(double)" title="class or interface in java.lang" class="external-link"><code>Math​.tanh(double)</code></a> method.
The range of input values shall be in the [-1 … 1].
Special cases:
<ul>
<li>For <var>x</var> = NaN, this method returns a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#isNaN(double)" title="class or interface in java.lang" class="external-link">NaN</a> value.</li>
<li>For <var>x</var> = -1, this method returns <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#NEGATIVE_INFINITY" title="class or interface in java.lang" class="external-link">negative infinity</a>.</li>
<li>For <var>x</var> = +1, this method returns <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#POSITIVE_INFINITY" title="class or interface in java.lang" class="external-link">positive infinity</a>.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>x</code> - the value for which to compute the inverse hyperbolic tangent.</dd>
<dt>Returns:</dt>
<dd>the inverse hyperbolic tangent of the given value.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#tanh(double)" title="class or interface in java.lang" class="external-link"><code>Math​.tanh(double)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isPositive(double)">
<h3>isPositive</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isPositive</span><wbr><span class="parameters">(double&nbsp;value)</span></div>
<div class="block">Returns <code>true</code> if the given value is positive, <em>excluding</em> negative zero.
Special cases:
<ul>
<li>If the value is <code>+0.0</code>, returns <code>true</code></li>
<li>If the value is <code>-0.0</code>, returns <b><code>false</code></b></li>
<li>If the value is <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#isNaN(double)" title="class or interface in java.lang" class="external-link"><code>Na­N</code></a>, returns <code>false</code></li>
</ul>
As seen from the above cases, this method distinguishes positive zero from negative zero.
The handling of zero values is the difference between invoking <code>is­Positive(double)</code>
and testing if (<var>value</var> &gt;= 0).</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - the value to test.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if the given value is positive, excluding negative zero.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#isPositiveZero(double)"><code>is­Positive­Zero(double)</code></a></li>
<li><a href="#isNegative(double)"><code>is­Negative(double)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isPositiveZero(double)">
<h3>isPositiveZero</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isPositiveZero</span><wbr><span class="parameters">(double&nbsp;value)</span></div>
<div class="block">Returns <code>true</code> if the given value is the positive zero (<code>+0.0</code>).
This method returns <code>false</code> for the negative zero (<code>-0.0</code>).
This method is equivalent to the following code, but potentially faster:
<blockquote><pre><font color="green">return</font> (value == 0) &amp;&amp; <b>isPositive</b>(value);</pre></blockquote></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - the value to test.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if the given value is +0.0 (not -0.0).</dd>
<dt>Since:</dt>
<dd>0.4</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#isPositive(double)"><code>is­Positive(double)</code></a></li>
<li><a href="#isNegativeZero(double)"><code>is­Negative­Zero(double)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isNegative(double)">
<h3>isNegative</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isNegative</span><wbr><span class="parameters">(double&nbsp;value)</span></div>
<div class="block">Returns <code>true</code> if the given value is negative, <em>including</em> negative zero.
Special cases:
<ul>
<li>If the value is <code>+0.0</code>, returns <code>false</code></li>
<li>If the value is <code>-0.0</code>, returns <b><code>true</code></b></li>
<li>If the value is <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#isNaN(double)" title="class or interface in java.lang" class="external-link"><code>Na­N</code></a>, returns <code>false</code></li>
</ul>
As seen from the above cases, this method distinguishes positive zero from negative zero.
The handling of zero values is the difference between invoking <code>is­Negative(double)</code>
and testing if (<var>value</var> &lt; 0).</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - the value to test.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if the given value is negative, including negative zero.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#isNegativeZero(double)"><code>is­Negative­Zero(double)</code></a></li>
<li><a href="#isPositive(double)"><code>is­Positive(double)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isNegativeZero(double)">
<h3>isNegativeZero</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isNegativeZero</span><wbr><span class="parameters">(double&nbsp;value)</span></div>
<div class="block">Returns <code>true</code> if the given value is the negative zero (<code>-0.0</code>).
This method returns <code>false</code> for the positive zero (<code>+0.0</code>).
This method is equivalent to the following code, but potentially faster:
<blockquote><pre><font color="green">return</font> (value == 0) &amp;&amp; <b>isNegative</b>(value);</pre></blockquote></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - the value to test.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if the given value is -0.0 (not +0.0).</dd>
<dt>Since:</dt>
<dd>0.4</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#isNegative(double)"><code>is­Negative(double)</code></a></li>
<li><a href="#isPositiveZero(double)"><code>is­Positive­Zero(double)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isSameSign(double,double)">
<h3>isSameSign</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isSameSign</span><wbr><span class="parameters">(double&nbsp;v1,
double&nbsp;v2)</span></div>
<div class="block">Returns <code>true</code> if the given values have the same sign, differentiating positive
and negative zeros.
Special cases:
<ul>
<li><code>+0.0</code> and <code>-0.0</code> are considered to have opposite sign</li>
<li>If any value is <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#isNaN(double)" title="class or interface in java.lang" class="external-link"><code>Na­N</code></a>, returns <code>false</code></li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>v1</code> - the first value.</dd>
<dd><code>v2</code> - the second value, to compare the sign with the first value.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if the given values are not NaN and have the same sign.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#signum(double)" title="class or interface in java.lang" class="external-link"><code>Math​.signum(double)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="xorSign(double,double)">
<h3>xorSign</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">xorSign</span><wbr><span class="parameters">(double&nbsp;value,
double&nbsp;sign)</span></div>
<div class="block">Returns the first floating-point argument with the sign reversed if the second floating-point
argument is negative. This method is similar to <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#copySign(double,double)" title="class or interface in java.lang" class="external-link">Math​.copy­Sign</a>(value, sign)</code> except that the sign is combined with an <cite>exclusive
or</cite> operation instead of being copied.
<p>This method makes no guarantee about whether <code>Na­N</code> values are handled as positive
or negative numbers. This is the same policy than <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#copySign(double,double)" title="class or interface in java.lang" class="external-link"><code>Math​.copy­Sign(double, double)</code></a>.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - the parameter providing the value that may need a sign change.</dd>
<dd><code>sign</code> - the parameter providing the sign to <cite>xor</cite> with the value.</dd>
<dt>Returns:</dt>
<dd>the provided value with its sign reversed if the <code>sign</code> parameter is negative.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#copySign(double,double)" title="class or interface in java.lang" class="external-link"><code>Math​.copy­Sign(double, double)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="epsilonEqual(float,float,float)">
<h3>epsilonEqual</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">epsilonEqual</span><wbr><span class="parameters">(float&nbsp;v1,
float&nbsp;v2,
float&nbsp;ε)</span></div>
<div class="block">Returns <code>true</code> if the given values are <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equal</a>
or if their difference is not greater than the given threshold. More specifically:
<ul>
<li>If both values are <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html#POSITIVE_INFINITY" title="class or interface in java.lang" class="external-link">positive infinity</a>, or
if both values are <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html#NEGATIVE_INFINITY" title="class or interface in java.lang" class="external-link">negative infinity</a>,
then this method returns <code>true</code>.</li>
<li>If both values <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html#isNaN(float)" title="class or interface in java.lang" class="external-link">are NaN</a>, then this method returns <code>true</code>.
Note that this method does not differentiate the various NaN values.</li>
<li>Otherwise, this method returns the result of the <code>abs(v1 - v2) &lt;= ε</code> comparison.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>v1</code> - the first value to compare.</dd>
<dd><code>v2</code> - the second value to compare.</dd>
<dd><code>ε</code> - the tolerance threshold, which must be positive.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if both values are equal given the tolerance threshold.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="epsilonEqual(double,double,double)">
<h3>epsilonEqual</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">epsilonEqual</span><wbr><span class="parameters">(double&nbsp;v1,
double&nbsp;v2,
double&nbsp;ε)</span></div>
<div class="block">Returns <code>true</code> if the given values are <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equal</a>
or if their difference is not greater than the given threshold. More specifically:
<ul>
<li>If both values are <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#POSITIVE_INFINITY" title="class or interface in java.lang" class="external-link">positive infinity</a>, or
if both values are <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#NEGATIVE_INFINITY" title="class or interface in java.lang" class="external-link">negative infinity</a>,
then this method returns <code>true</code>.</li>
<li>If both values <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#isNaN(double)" title="class or interface in java.lang" class="external-link">are NaN</a>, then this method returns <code>true</code>.
Note that this method does not differentiate the various NaN values.</li>
<li>Otherwise, this method returns the result of the <code>abs(v1 - v2) &lt;= ε</code> comparison.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>v1</code> - the first value to compare.</dd>
<dd><code>v2</code> - the second value to compare.</dd>
<dd><code>ε</code> - the tolerance threshold, which must be positive.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if both values are equal given the tolerance threshold.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toNanFloat(int)">
<h3>toNanFloat</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">float</span>&nbsp;<span class="element-name">toNanFloat</span><wbr><span class="parameters">(int&nbsp;ordinal)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></span></div>
<div class="block">Returns a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html#isNaN(float)" title="class or interface in java.lang" class="external-link">NaN</a> number for the specified ordinal value.
Valid NaN numbers in Java can have bit fields in the ranges listed below:
<ul>
<li>[<code>0x7F800001</code> … <code>0x7FFFFFFF</code>], with
<code>0x7FC00000</code> as the bit fields of the standard <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html#NaN" title="class or interface in java.lang" class="external-link"><code>Float​.Na­N</code></a> value</li>
<li>[<code>0x­FF800001</code> … <code>0x­FFFFFFFF</code>]</li>
</ul>
Some of those bits, named the <cite>payload</cite>, can be used for storing custom information.
This method maps some of the payload values to each ordinal value.
<p>This method guarantees that <code>to­Nan­Float(0)</code> returns the standard <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html#NaN" title="class or interface in java.lang" class="external-link"><code>Float​.Na­N</code></a> value.
For all other <code>ordinal</code> values, the relationship to the payload values is implementation dependent
and may change in any future version of the SIS library. The current implementation restricts the
range of allowed ordinal values to a smaller one than the range of all possible values.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>ordinal</code> - the NaN ordinal value, from <a href="#MIN_NAN_ORDINAL">-2097152</a> to <a href="#MAX_NAN_ORDINAL">2097151</a> inclusive.</dd>
<dt>Returns:</dt>
<dd>one of the legal <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html#isNaN(float)" title="class or interface in java.lang" class="external-link">NaN</a> values as a float.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if the specified ordinal is out of range.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html#intBitsToFloat(int)" title="class or interface in java.lang" class="external-link"><code>Float​.int­Bits­To­Float(int)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toNanOrdinal(float)">
<h3>toNanOrdinal</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">toNanOrdinal</span><wbr><span class="parameters">(float&nbsp;value)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></span></div>
<div class="block">Returns the ordinal value of the given NaN number.
This method is the converse of <a href="#toNanFloat(int)"><code>to­Nan­Float(int)</code></a>.
<p>If the given float is the standard <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html#NaN" title="class or interface in java.lang" class="external-link"><code>Float​.Na­N</code></a> value, then this method returns 0.
For all other values, the relationship between the float payload and the returned ordinal
is implementation dependent and may change in any future Apache SIS version.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - the value from which to get the NaN ordinal value.</dd>
<dt>Returns:</dt>
<dd>the NaN ordinal value of the given floating point value.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if the given value is not a NaN value,
or does not use a supported bits pattern.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="quadrupleToDouble(long,long)">
<h3>quadrupleToDouble</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">quadrupleToDouble</span><wbr><span class="parameters">(long&nbsp;l0,
long&nbsp;l1)</span></div>
<div class="block">Converts two long bits values containing a IEEE 754 quadruple precision floating point number
to a double precision floating point number. About 17 decimal digits of precision may be lost
due to the <code>double</code> type having only half the capacity of quadruple precision type.
<p>Some quadruple precision values cannot be represented in double precision and are mapped
to <code>double</code> values as below:</p>
<ul>
<li>Values having a magnitude less than <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#MIN_VALUE" title="class or interface in java.lang" class="external-link"><code>Double​.MIN_VALUE</code></a> are mapped to
positive or negative zero.</li>
<li>Values having a magnitude greater than <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#MAX_VALUE" title="class or interface in java.lang" class="external-link"><code>Double​.MAX_VALUE</code></a> are mapped to
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#POSITIVE_INFINITY" title="class or interface in java.lang" class="external-link"><code>Double​.POSITIVE_INFINITY</code></a> or <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#NEGATIVE_INFINITY" title="class or interface in java.lang" class="external-link"><code>Double​.NEGATIVE_INFINITY</code></a>.</li>
<li>All NaN values are currently collapsed to the single "canonical" <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#NaN" title="class or interface in java.lang" class="external-link"><code>Double​.Na­N</code></a> value
(this policy may be revisited in future SIS version).</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>l0</code> - upper part of the quadruple precision floating point number.</dd>
<dd><code>l1</code> - lower part of the quadruple precision floating point number.</dd>
<dt>Returns:</dt>
<dd>double precision approximation.</dd>
<dt>Since:</dt>
<dd>0.7</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format">Quadruple-precision floating-point format on Wikipedia</a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="nextPrimeNumber(int)">
<h3>nextPrimeNumber</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">nextPrimeNumber</span><wbr><span class="parameters">(int&nbsp;number)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></span></div>
<div class="block">Returns the first prime number equals or greater than the given value.
Current implementation accepts only values in the
[2 … <a href="#HIGHEST_SUPPORTED_PRIME_NUMBER">65521</a>] range.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>number</code> - the number for which to find the next prime.</dd>
<dt>Returns:</dt>
<dd>the given number if it is a prime number, or the next prime number otherwise.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if the given value is outside the supported range.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/math/BigInteger.html#isProbablePrime(int)" title="class or interface in java.math" class="external-link"><code>Big­Integer​.is­Probable­Prime(int)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="divisors(int)">
<h3>divisors</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int[]</span>&nbsp;<span class="element-name">divisors</span><wbr><span class="parameters">(int&nbsp;number)</span></div>
<div class="block">Returns the divisors of the specified number as positive integers. For any value other
than <code>O</code> (which returns an empty array), the first element in the returned array
is always <code>1</code> and the last element is always the absolute value of <code>number</code>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>number</code> - the number for which to compute the divisors.</dd>
<dt>Returns:</dt>
<dd>the divisors in strictly increasing order.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="commonDivisors(int...)">
<h3>commonDivisors</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int[]</span>&nbsp;<span class="element-name">commonDivisors</span><wbr><span class="parameters">(int...&nbsp;numbers)</span></div>
<div class="block">Returns the positive divisors which are common to all the specified numbers.
The returned array always starts with value 1, unless the given value is 0
in which case this method returns an empty array.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>numbers</code> - the numbers for which to compute the divisors, in any order.</dd>
<dt>Returns:</dt>
<dd>the divisors common to all the given numbers, in strictly increasing order.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="polynomialRoots(double...)">
<h3>polynomialRoots</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double[]</span>&nbsp;<span class="element-name">polynomialRoots</span><wbr><span class="parameters">(double...&nbsp;coefficients)</span></div>
<div class="block">Returns the real (non-complex) roots of a polynomial equation having the given coefficients.
This method returns the <var>x</var> values for which <var>y</var>=0 in the following equation:
<blockquote><var>y</var> =
<var>c<sub>0</sub></var> +
<var>c<sub>1</sub></var>â‹…<var>x</var> +
<var>c<sub>2</sub></var>â‹…<var>x</var><sup>2</sup> +
<var>c<sub>3</sub></var>⋅<var>x</var><sup>3</sup> + … +
<var>c<sub>n</sub></var>â‹…<var>x</var><sup>n</sup>
</blockquote>
Current implementation can resolve polynomials described by a maximum of 5 coefficients, ignoring
leading and trailing zeros. They correspond to linear, quadratic, cubic and quartic polynomials.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>coefficients</code> - the <var>c<sub>0</sub></var>, <var>c<sub>1</sub></var>, <var>c<sub>2</sub></var>, …
<var>c<sub>n</sub></var> coefficients, in that order.</dd>
<dt>Returns:</dt>
<dd>the non-complex roots, or an empty array if none.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang" class="external-link">Unsupported­Operation­Exception</a></code> - if given arguments contain more non-zero coefficients than this method can handle.</dd>
<dt>Since:</dt>
<dd>1.0</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/geom/QuadCurve2D.html#solveQuadratic(double%5B%5D)" title="class or interface in java.awt.geom" class="external-link"><code>Quad­Curve2D​.solve­Quadratic(double[])</code></a></li>
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/geom/CubicCurve2D.html#solveCubic(double%5B%5D)" title="class or interface in java.awt.geom" class="external-link"><code>Cubic­Curve2D​.solve­Cubic(double[])</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2010&#x2013;2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>