blob: 8b9a968e749b9872f806d1548f0c66e25affd54f [file]
<!DOCTYPE HTML>
<html lang>
<head>
<!-- Generated by javadoc (25) -->
<title>Util (datasketches-java 9.0.1-SNAPSHOT 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.datasketches.common, class: Util">
<meta name="generator" content="javadoc/ClassWriter">
<link rel="stylesheet" type="text/css" href="../../../../resource-files/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="../../../../resource-files/stylesheet.css">
<script type="text/javascript" src="../../../../script-files/script.js"></script>
<script type="text/javascript" src="../../../../script-files/jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="../../../../script-files/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">const pathtoroot = "../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="nav-content">
<div class="nav-menu-button"><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>
<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 class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/Util.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="../../../../search.html">Search</a></li>
<li><a href="../../../../help-doc.html#class">Help</a></li>
</ul>
</div>
</div>
<div class="sub-nav">
<div class="nav-content">
<ol class="sub-nav-list">
<li><a href="package-summary.html">org.apache.datasketches.common</a></li>
<li><a href="Util.html" class="current-selection">Util</a></li>
</ol>
<div class="nav-list-search"><input type="text" id="search-input" disabled placeholder="Search documentation (type /)" aria-label="Search in documentation" autocomplete="off" spellcheck="false"><input type="reset" id="reset-search" disabled value="Reset"></div>
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="main-grid">
<nav role="navigation" class="toc" aria-label="Table of contents">
<div class="toc-header">Contents&nbsp;<input type="text" class="filter-input" disabled placeholder="Filter contents (type .)" aria-label="Filter table of contents" autocomplete="off" spellcheck="false"><input type="reset" class="reset-filter" disabled tabindex="-1" value="Reset"></div>
<ol class="toc-list" tabindex="-1">
<li><a href="#" tabindex="0">Description</a></li>
<li><a href="#field-summary" tabindex="0">Field Summary</a></li>
<li><a href="#method-summary" tabindex="0">Method Summary</a></li>
<li><a href="#field-detail" tabindex="0">Field Details</a>
<ol class="toc-list">
<li><a href="#LS" tabindex="0">LS</a></li>
<li><a href="#TAB" tabindex="0">TAB</a></li>
<li><a href="#LOG2" tabindex="0">LOG2</a></li>
<li><a href="#INVERSE_GOLDEN_U64" tabindex="0">INVERSE_GOLDEN_U64</a></li>
<li><a href="#INVERSE_GOLDEN" tabindex="0">INVERSE_GOLDEN</a></li>
<li><a href="#LONG_MAX_VALUE_AS_DOUBLE" tabindex="0">LONG_MAX_VALUE_AS_DOUBLE</a></li>
<li><a href="#DEFAULT_UPDATE_SEED" tabindex="0">DEFAULT_UPDATE_SEED</a></li>
</ol>
</li>
<li><a href="#method-detail" tabindex="0">Method Details</a>
<ol class="toc-list">
<li><a href="#bytesToInt(byte%5B%5D)" tabindex="0">bytesToInt(byte[])</a></li>
<li><a href="#bytesToLong(byte%5B%5D)" tabindex="0">bytesToLong(byte[])</a></li>
<li><a href="#intToBytes(int,byte%5B%5D)" tabindex="0">intToBytes(int, byte[])</a></li>
<li><a href="#longToBytes(long,byte%5B%5D)" tabindex="0">longToBytes(long, byte[])</a></li>
<li><a href="#longToHexBytes(long)" tabindex="0">longToHexBytes(long)</a></li>
<li><a href="#bytesToString(byte%5B%5D,boolean,boolean,java.lang.String)" tabindex="0">bytesToString(byte[], boolean, boolean, String)</a></li>
<li><a href="#nanoSecToString(long)" tabindex="0">nanoSecToString(long)</a></li>
<li><a href="#milliSecToString(long)" tabindex="0">milliSecToString(long)</a></li>
<li><a href="#zeroPad(java.lang.String,int)" tabindex="0">zeroPad(String, int)</a></li>
<li><a href="#characterPad(java.lang.String,int,char,boolean)" tabindex="0">characterPad(String, int, char, boolean)</a></li>
<li><a href="#checkIfMultipleOf8AndGT0(long,java.lang.String)" tabindex="0">checkIfMultipleOf8AndGT0(long, String)</a></li>
<li><a href="#isMultipleOf8AndGT0(long)" tabindex="0">isMultipleOf8AndGT0(long)</a></li>
<li><a href="#isPowerOf2(long)" tabindex="0">isPowerOf2(long)</a></li>
<li><a href="#checkIfPowerOf2(long,java.lang.String)" tabindex="0">checkIfPowerOf2(long, String)</a></li>
<li><a href="#ceilingPowerOf2(int)" tabindex="0">ceilingPowerOf2(int)</a></li>
<li><a href="#ceilingPowerOf2(long)" tabindex="0">ceilingPowerOf2(long)</a></li>
<li><a href="#floorPowerOf2(int)" tabindex="0">floorPowerOf2(int)</a></li>
<li><a href="#floorPowerOf2(long)" tabindex="0">floorPowerOf2(long)</a></li>
<li><a href="#ceilingMultiple2expK(long,int)" tabindex="0">ceilingMultiple2expK(long, int)</a></li>
<li><a href="#invPow2(int)" tabindex="0">invPow2(int)</a></li>
<li><a href="#pwr2SeriesNext(int,long)" tabindex="0">pwr2SeriesNext(int, long)</a></li>
<li><a href="#pwr2SeriesPrev(int,int)" tabindex="0">pwr2SeriesPrev(int, int)</a></li>
<li><a href="#powerSeriesNextDouble(int,double,boolean,double)" tabindex="0">powerSeriesNextDouble(int, double, boolean, double)</a></li>
<li><a href="#ceilingPowerBaseOfDouble(double,double)" tabindex="0">ceilingPowerBaseOfDouble(double, double)</a></li>
<li><a href="#floorPowerBaseOfDouble(double,double)" tabindex="0">floorPowerBaseOfDouble(double, double)</a></li>
<li><a href="#log2(double)" tabindex="0">log2(double)</a></li>
<li><a href="#logBaseOfX(double,double)" tabindex="0">logBaseOfX(double, double)</a></li>
<li><a href="#numberOfTrailingOnes(long)" tabindex="0">numberOfTrailingOnes(long)</a></li>
<li><a href="#numberOfLeadingOnes(long)" tabindex="0">numberOfLeadingOnes(long)</a></li>
<li><a href="#exactLog2OfInt(int,java.lang.String)" tabindex="0">exactLog2OfInt(int, String)</a></li>
<li><a href="#exactLog2OfLong(long,java.lang.String)" tabindex="0">exactLog2OfLong(long, String)</a></li>
<li><a href="#exactLog2OfInt(int)" tabindex="0">exactLog2OfInt(int)</a></li>
<li><a href="#exactLog2OfLong(long)" tabindex="0">exactLog2OfLong(long)</a></li>
<li><a href="#checkBounds(long,long,long)" tabindex="0">checkBounds(long, long, long)</a></li>
<li><a href="#checkProbability(double,java.lang.String)" tabindex="0">checkProbability(double, String)</a></li>
<li><a href="#isLessThanUnsigned(long,long)" tabindex="0">isLessThanUnsigned(long, long)</a></li>
<li><a href="#isEven(long)" tabindex="0">isEven(long)</a></li>
<li><a href="#isOdd(long)" tabindex="0">isOdd(long)</a></li>
<li><a href="#bitAt(long,int)" tabindex="0">bitAt(long, int)</a></li>
<li><a href="#numDigits(long)" tabindex="0">numDigits(long)</a></li>
<li><a href="#longToFixedLengthString(long,int)" tabindex="0">longToFixedLengthString(long, int)</a></li>
<li><a href="#minT(java.lang.Object,java.lang.Object,java.util.Comparator)" tabindex="0">minT(Object, Object, Comparator)</a></li>
<li><a href="#maxT(java.lang.Object,java.lang.Object,java.util.Comparator)" tabindex="0">maxT(Object, Object, Comparator)</a></li>
<li><a href="#lt(java.lang.Object,java.lang.Object,java.util.Comparator)" tabindex="0">lt(Object, Object, Comparator)</a></li>
<li><a href="#le(java.lang.Object,java.lang.Object,java.util.Comparator)" tabindex="0">le(Object, Object, Comparator)</a></li>
<li><a href="#clear(java.lang.foreign.MemorySegment)" tabindex="0">clear(MemorySegment)</a></li>
<li><a href="#clear(java.lang.foreign.MemorySegment,long,long)" tabindex="0">clear(MemorySegment, long, long)</a></li>
<li><a href="#clearBits(java.lang.foreign.MemorySegment,long,byte)" tabindex="0">clearBits(MemorySegment, long, byte)</a></li>
<li><a href="#equalContents(java.lang.foreign.MemorySegment,java.lang.foreign.MemorySegment)" tabindex="0">equalContents(MemorySegment, MemorySegment)</a></li>
<li><a href="#equalContents(java.lang.foreign.MemorySegment,long,java.lang.foreign.MemorySegment,long,long)" tabindex="0">equalContents(MemorySegment, long, MemorySegment, long, long)</a></li>
<li><a href="#fill(java.lang.foreign.MemorySegment,long,long,byte)" tabindex="0">fill(MemorySegment, long, long, byte)</a></li>
<li><a href="#alignedHeapSegment(int,boolean)" tabindex="0">alignedHeapSegment(int, boolean)</a></li>
<li><a href="#setBits(java.lang.foreign.MemorySegment,long,byte)" tabindex="0">setBits(MemorySegment, long, byte)</a></li>
<li><a href="#computeSeedHash(long)" tabindex="0">computeSeedHash(long)</a></li>
<li><a href="#checkSeedHashes(short,short)" tabindex="0">checkSeedHashes(short, short)</a></li>
</ol>
</li>
</ol>
<button class="hide-sidebar"><span>Hide sidebar&nbsp;</span><img src="../../../../resource-files/left.svg" alt="Hide sidebar"></button><button class="show-sidebar"><img src="../../../../resource-files/right.svg" alt="Show sidebar"><span>&nbsp;Show sidebar</span></button></nav>
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<h1 title="Class Util" class="title">Class Util</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">org.apache.datasketches.common.Util</div>
</div>
<section class="class-description" id="class-description">
<hr>
<div class="horizontal-scroll">
<div class="type-signature"><span class="modifiers">public final class </span><span class="element-name type-name-label">Util</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
<div class="block">Common utility functions.</div>
<dl class="notes">
<dt>Author:</dt>
<dd>Lee Rhodes</dd>
</dl>
</div>
</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 long</code></div>
<div class="col-second even-row-color"><code><a href="#DEFAULT_UPDATE_SEED" class="member-name-link">DEFAULT_UPDATE_SEED</a></code></div>
<div class="col-last even-row-color">
<div class="block">The seed 9001 used in the sketch update methods is a prime number that
was chosen very early on in experimental testing.</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="#INVERSE_GOLDEN" class="member-name-link">INVERSE_GOLDEN</a></code></div>
<div class="col-last odd-row-color">
<div class="block">The inverse golden ratio as a fraction.</div>
</div>
<div class="col-first even-row-color"><code>static final long</code></div>
<div class="col-second even-row-color"><code><a href="#INVERSE_GOLDEN_U64" class="member-name-link">INVERSE_GOLDEN_U64</a></code></div>
<div class="col-last even-row-color">
<div class="block">The inverse golden ratio as an unsigned long.</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="#LOG2" class="member-name-link">LOG2</a></code></div>
<div class="col-last odd-row-color">
<div class="block">The natural logarithm of 2.0.</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="#LONG_MAX_VALUE_AS_DOUBLE" class="member-name-link">LONG_MAX_VALUE_AS_DOUBLE</a></code></div>
<div class="col-last even-row-color">
<div class="block">Long.MAX_VALUE as a double.</div>
</div>
<div class="col-first odd-row-color"><code>static final <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color"><code><a href="#LS" class="member-name-link">LS</a></code></div>
<div class="col-last odd-row-color">
<div class="block">The java line separator character as a String.</div>
</div>
<div class="col-first even-row-color"><code>static final char</code></div>
<div class="col-second even-row-color"><code><a href="#TAB" class="member-name-link">TAB</a></code></div>
<div class="col-last even-row-color">
<div class="block">The tab character</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" aria-labelledby="method-summary-table-tab0">
<div class="summary-table three-column-summary">
<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 <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#alignedHeapSegment(int,boolean)" class="member-name-link">alignedHeapSegment</a><wbr>(int&nbsp;capacityBytes,
boolean&nbsp;aligned)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Request a new heap MemorySegment with the given capacityBytes and either 8-byte aligned or one byte aligned.</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="#bitAt(long,int)" class="member-name-link">bitAt</a><wbr>(long&nbsp;number,
int&nbsp;bitPos)</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 one if the bit at bitPos is a one, otherwise zero.</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="#bytesToInt(byte%5B%5D)" class="member-name-link">bytesToInt</a><wbr>(byte[]&nbsp;arr)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns an int extracted from a Little-Endian byte array.</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="#bytesToLong(byte%5B%5D)" class="member-name-link">bytesToLong</a><wbr>(byte[]&nbsp;arr)</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 long extracted from a Little-Endian byte array.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#bytesToString(byte%5B%5D,boolean,boolean,java.lang.String)" class="member-name-link">bytesToString</a><wbr>(byte[]&nbsp;arr,
boolean&nbsp;signed,
boolean&nbsp;littleEndian,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;sep)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns a string view of a byte array</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="#ceilingMultiple2expK(long,int)" class="member-name-link">ceilingMultiple2expK</a><wbr>(long&nbsp;n,
int&nbsp;k)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">This is a long integer equivalent to <i>Math.ceil(n / (double)(1 &lt;&lt; k))</i>
where: <i>0 &lt; k &le; 6</i> and <i>n</i> is a non-negative long.</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="#ceilingPowerBaseOfDouble(double,double)" class="member-name-link">ceilingPowerBaseOfDouble</a><wbr>(double&nbsp;base,
double&nbsp;n)</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 ceiling of a given <i>n</i> given a <i>base</i>, where the ceiling is an integral power of the base.</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="#ceilingPowerOf2(int)" class="member-name-link">ceilingPowerOf2</a><wbr>(int&nbsp;n)</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 int ceiling power of 2 within the range [1, 2^30].</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static long</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#ceilingPowerOf2(long)" class="member-name-link">ceilingPowerOf2</a><wbr>(long&nbsp;n)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the long ceiling power of 2 within the range [1, 2^62].</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#characterPad(java.lang.String,int,char,boolean)" class="member-name-link">characterPad</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;s,
int&nbsp;fieldLength,
char&nbsp;padChar,
boolean&nbsp;postpend)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Prepend or postpend the given string with the given character to fill the given field length.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkBounds(long,long,long)" class="member-name-link">checkBounds</a><wbr>(long&nbsp;reqOff,
long&nbsp;reqLen,
long&nbsp;allocSize)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Check the requested offset and length against the allocated size.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkIfMultipleOf8AndGT0(long,java.lang.String)" class="member-name-link">checkIfMultipleOf8AndGT0</a><wbr>(long&nbsp;v,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;argName)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Checks if parameter v is a multiple of 8 and greater than zero.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkIfPowerOf2(long,java.lang.String)" class="member-name-link">checkIfPowerOf2</a><wbr>(long&nbsp;n,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;argName)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Checks the given long argument if it is a positive integer power of 2.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkProbability(double,java.lang.String)" class="member-name-link">checkProbability</a><wbr>(double&nbsp;p,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;argName)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Checks the given parameter to make sure it is positive and between 0.0 inclusive and 1.0
inclusive.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static short</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkSeedHashes(short,short)" class="member-name-link">checkSeedHashes</a><wbr>(short&nbsp;seedHashA,
short&nbsp;seedHashB)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Check if the two seed hashes are equal.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#clear(java.lang.foreign.MemorySegment)" class="member-name-link">clear</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Clears all bytes of this MemorySegment to zero.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#clear(java.lang.foreign.MemorySegment,long,long)" class="member-name-link">clear</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg,
long&nbsp;offsetBytes,
long&nbsp;lengthBytes)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Clears a portion of this MemorySegment to zero.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#clearBits(java.lang.foreign.MemorySegment,long,byte)" class="member-name-link">clearBits</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg,
long&nbsp;offsetBytes,
byte&nbsp;bitMask)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Clears the bits defined by the bitMask</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static short</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#computeSeedHash(long)" class="member-name-link">computeSeedHash</a><wbr>(long&nbsp;seed)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes and checks the 16-bit seed hash from the given long seed.</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="#equalContents(java.lang.foreign.MemorySegment,long,java.lang.foreign.MemorySegment,long,long)" class="member-name-link">equalContents</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg1,
long&nbsp;seg1offsetBytes,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg2,
long&nbsp;seg2offsetBytes,
long&nbsp;lengthBytes)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns true if both segments have the same content for the specified region.</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="#equalContents(java.lang.foreign.MemorySegment,java.lang.foreign.MemorySegment)" class="member-name-link">equalContents</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg1,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg2)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns true if both segments have the same contents and the same length.</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="#exactLog2OfInt(int)" class="member-name-link">exactLog2OfInt</a><wbr>(int&nbsp;powerOf2)</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 log2 of the given int value if it is an exact power of 2 and greater than zero.</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="#exactLog2OfInt(int,java.lang.String)" class="member-name-link">exactLog2OfInt</a><wbr>(int&nbsp;powerOf2,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;argName)</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 log2 of the given int value if it is an exact power of 2 and greater than zero.</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="#exactLog2OfLong(long)" class="member-name-link">exactLog2OfLong</a><wbr>(long&nbsp;powerOf2)</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 log2 of the given long value if it is an exact power of 2 and greater than zero.</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="#exactLog2OfLong(long,java.lang.String)" class="member-name-link">exactLog2OfLong</a><wbr>(long&nbsp;powerOf2,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;argName)</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 log2 of the given long value if it is an exact power of 2 and greater than zero.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#fill(java.lang.foreign.MemorySegment,long,long,byte)" class="member-name-link">fill</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg,
long&nbsp;offsetBytes,
long&nbsp;lengthBytes,
byte&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">Fills a portion of this Memory region to the given byte 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="#floorPowerBaseOfDouble(double,double)" class="member-name-link">floorPowerBaseOfDouble</a><wbr>(double&nbsp;base,
double&nbsp;n)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the floor of a given <i>n</i> given <i>base</i>, where the floor is an integral power of the base.</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="#floorPowerOf2(int)" class="member-name-link">floorPowerOf2</a><wbr>(int&nbsp;n)</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 floor power of 2 given <i>n</i> is in the range [1, 2^31-1].</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static long</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#floorPowerOf2(long)" class="member-name-link">floorPowerOf2</a><wbr>(long&nbsp;n)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the floor power of 2 given <i>n</i> is in the range [1, 2^63-1].</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#intToBytes(int,byte%5B%5D)" class="member-name-link">intToBytes</a><wbr>(int&nbsp;v,
byte[]&nbsp;arr)</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 Little-Endian byte array extracted from the given int.</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="#invPow2(int)" class="member-name-link">invPow2</a><wbr>(int&nbsp;e)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the inverse integer power of 2: 1/(2^e) = 2^(-e).</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="#isEven(long)" class="member-name-link">isEven</a><wbr>(long&nbsp;n)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns true if given n is even.</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="#isLessThanUnsigned(long,long)" class="member-name-link">isLessThanUnsigned</a><wbr>(long&nbsp;n1,
long&nbsp;n2)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Unsigned compare with longs.</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="#isMultipleOf8AndGT0(long)" class="member-name-link">isMultipleOf8AndGT0</a><wbr>(long&nbsp;v)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns true if v is a multiple of 8 and greater than 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="#isOdd(long)" class="member-name-link">isOdd</a><wbr>(long&nbsp;n)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns true if given n is odd.</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="#isPowerOf2(long)" class="member-name-link">isPowerOf2</a><wbr>(long&nbsp;n)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns true if given long argument is exactly a positive power of 2.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static &lt;T&gt;&nbsp;boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#le(java.lang.Object,java.lang.Object,java.util.Comparator)" class="member-name-link">le</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item1,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item2,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Comparator.html" title="class or interface in java.util" class="external-link">Comparator</a>&lt;? super T&gt;&nbsp;c)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Is item1 Less-Than-Or-Equal-To item2?</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="#log2(double)" class="member-name-link">log2</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">The log<sub>2</sub>(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="#logBaseOfX(double,double)" class="member-name-link">logBaseOfX</a><wbr>(double&nbsp;base,
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 log<sub>base</sub>(x).</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#longToBytes(long,byte%5B%5D)" class="member-name-link">longToBytes</a><wbr>(long&nbsp;v,
byte[]&nbsp;arr)</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 Little-Endian byte array extracted from the given long.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#longToFixedLengthString(long,int)" class="member-name-link">longToFixedLengthString</a><wbr>(long&nbsp;number,
int&nbsp;length)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Converts the given number to a string prepended with spaces, if necessary, to
match the given length.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#longToHexBytes(long)" class="member-name-link">longToHexBytes</a><wbr>(long&nbsp;v)</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 string of spaced hex bytes in Big-Endian order.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static &lt;T&gt;&nbsp;boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#lt(java.lang.Object,java.lang.Object,java.util.Comparator)" class="member-name-link">lt</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item1,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item2,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Comparator.html" title="class or interface in java.util" class="external-link">Comparator</a>&lt;? super T&gt;&nbsp;c)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Is item1 Less-Than item2?</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static &lt;T&gt;&nbsp;<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#maxT(java.lang.Object,java.lang.Object,java.util.Comparator)" class="member-name-link">maxT</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item1,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item2,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Comparator.html" title="class or interface in java.util" class="external-link">Comparator</a>&lt;? super T&gt;&nbsp;c)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Finds the maximum of two generic items</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#milliSecToString(long)" class="member-name-link">milliSecToString</a><wbr>(long&nbsp;mS)</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 given time in milliseconds formatted as Hours:Min:Sec.mSec</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static &lt;T&gt;&nbsp;<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#minT(java.lang.Object,java.lang.Object,java.util.Comparator)" class="member-name-link">minT</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item1,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item2,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Comparator.html" title="class or interface in java.util" class="external-link">Comparator</a>&lt;? super T&gt;&nbsp;c)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Finds the minimum of two generic items</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#nanoSecToString(long)" class="member-name-link">nanoSecToString</a><wbr>(long&nbsp;nS)</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 given time in nanoseconds formatted as Sec.mSec_uSec_nSec</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="#numberOfLeadingOnes(long)" class="member-name-link">numberOfLeadingOnes</a><wbr>(long&nbsp;v)</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 number of one bits preceding the highest-order ("leftmost") zero-bit in the
two's complement binary representation of the specified long value, or 64 if the value is equal
to minus one.</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="#numberOfTrailingOnes(long)" class="member-name-link">numberOfTrailingOnes</a><wbr>(long&nbsp;v)</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 number of one bits following the lowest-order ("rightmost") zero-bit in the
two's complement binary representation of the specified long value, or 64 if the value is equal
to minus one.</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="#numDigits(long)" class="member-name-link">numDigits</a><wbr>(long&nbsp;n)</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 number of decimal digits of the number n</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="#powerSeriesNextDouble(int,double,boolean,double)" class="member-name-link">powerSeriesNextDouble</a><wbr>(int&nbsp;ppb,
double&nbsp;curPoint,
boolean&nbsp;roundToLong,
double&nbsp;logBase)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the next larger double in the power series
<i>point = logBase<sup>( i / ppb )</sup></i> given the current point in the series.</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="#pwr2SeriesNext(int,long)" class="member-name-link">pwr2SeriesNext</a><wbr>(int&nbsp;ppo,
long&nbsp;curPoint)</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 next larger integer point in the power series
<i>point = 2<sup>( i / ppo )</sup></i> given the current point in the series.</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="#pwr2SeriesPrev(int,int)" class="member-name-link">pwr2SeriesPrev</a><wbr>(int&nbsp;ppo,
int&nbsp;curPoint)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the previous, smaller integer point in the power series
<i>point = 2<sup>( i / ppo )</sup></i> given the current point in the series.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#setBits(java.lang.foreign.MemorySegment,long,byte)" class="member-name-link">setBits</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg,
long&nbsp;offsetBytes,
byte&nbsp;bitMask)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Sets the bits defined by the bitMask</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#zeroPad(java.lang.String,int)" class="member-name-link">zeroPad</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;s,
int&nbsp;fieldLength)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Prepend the given string with zeros.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#method-summary" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/25/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/25/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/25/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/25/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/25/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/25/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/25/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="LS">
<h3>LS</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">LS</span></div>
<div class="block">The java line separator character as a String.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="TAB">
<h3>TAB</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">char</span>&nbsp;<span class="element-name">TAB</span></div>
<div class="block">The tab character</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="../../../../constant-values.html#org.apache.datasketches.common.Util.TAB">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="LOG2">
<h3>LOG2</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">LOG2</span></div>
<div class="block">The natural logarithm of 2.0.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="INVERSE_GOLDEN_U64">
<h3>INVERSE_GOLDEN_U64</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">INVERSE_GOLDEN_U64</span></div>
<div class="block">The inverse golden ratio as an unsigned long.</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="../../../../constant-values.html#org.apache.datasketches.common.Util.INVERSE_GOLDEN_U64">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="INVERSE_GOLDEN">
<h3>INVERSE_GOLDEN</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">INVERSE_GOLDEN</span></div>
<div class="block">The inverse golden ratio as a fraction.
This has more precision than using the formula: (Math.sqrt(5.0) - 1.0) / 2.0.</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="../../../../constant-values.html#org.apache.datasketches.common.Util.INVERSE_GOLDEN">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="LONG_MAX_VALUE_AS_DOUBLE">
<h3>LONG_MAX_VALUE_AS_DOUBLE</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">LONG_MAX_VALUE_AS_DOUBLE</span></div>
<div class="block">Long.MAX_VALUE as a double.</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="../../../../constant-values.html#org.apache.datasketches.common.Util.LONG_MAX_VALUE_AS_DOUBLE">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="DEFAULT_UPDATE_SEED">
<h3>DEFAULT_UPDATE_SEED</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">DEFAULT_UPDATE_SEED</span></div>
<div class="block">The seed 9001 used in the sketch update methods is a prime number that
was chosen very early on in experimental testing. Choosing a seed is somewhat arbitrary, and
the author cannot prove that this particular seed is somehow superior to other seeds. There
was some early Internet discussion that a seed of 0 did not produce as clean avalanche diagrams
as non-zero seeds, but this may have been more related to the MurmurHash2 release, which did
have some issues. As far as the author can determine, MurmurHash3 does not have these problems.
<p>In order to perform set operations on two sketches it is critical that the same hash
function and seed are identical for both sketches, otherwise the assumed 1:1 relationship
between the original source key value and the hashed bit string would be violated. Once
you have developed a history of stored sketches you are stuck with it.
<p><b>WARNING:</b> This seed is used internally by library sketches in different
packages and thus must be declared public. However, this seed value must not be used by library
users with the MurmurHash3 function. It should be viewed as existing for exclusive, private
use by the library.
<p><a href="../../../../resources/dictionary.html#defaultUpdateSeed">See Default Update Seed</a></div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="../../../../constant-values.html#org.apache.datasketches.common.Util.DEFAULT_UPDATE_SEED">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</div>
</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="bytesToInt(byte[])">
<h3>bytesToInt</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">bytesToInt</span><wbr><span class="parameters">(byte[]&nbsp;arr)</span></div>
<div class="block">Returns an int extracted from a Little-Endian byte array.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>arr</code> - the given byte array</dd>
<dt>Returns:</dt>
<dd>an int extracted from a Little-Endian byte array.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="bytesToLong(byte[])">
<h3>bytesToLong</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">bytesToLong</span><wbr><span class="parameters">(byte[]&nbsp;arr)</span></div>
<div class="block">Returns a long extracted from a Little-Endian byte array.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>arr</code> - the given byte array</dd>
<dt>Returns:</dt>
<dd>a long extracted from a Little-Endian byte array.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="intToBytes(int,byte[])">
<h3>intToBytes</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">intToBytes</span><wbr><span class="parameters">(int&nbsp;v,
byte[]&nbsp;arr)</span></div>
<div class="block">Returns a Little-Endian byte array extracted from the given int.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>v</code> - the given int</dd>
<dd><code>arr</code> - a given array of 4 bytes that will be returned with the data</dd>
<dt>Returns:</dt>
<dd>a Little-Endian byte array extracted from the given int.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="longToBytes(long,byte[])">
<h3>longToBytes</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">longToBytes</span><wbr><span class="parameters">(long&nbsp;v,
byte[]&nbsp;arr)</span></div>
<div class="block">Returns a Little-Endian byte array extracted from the given long.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>v</code> - the given long</dd>
<dd><code>arr</code> - a given array of 8 bytes that will be returned with the data</dd>
<dt>Returns:</dt>
<dd>a Little-Endian byte array extracted from the given long.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="longToHexBytes(long)">
<h3>longToHexBytes</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">longToHexBytes</span><wbr><span class="parameters">(long&nbsp;v)</span></div>
<div class="block">Returns a string of spaced hex bytes in Big-Endian order.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>v</code> - the given long</dd>
<dt>Returns:</dt>
<dd>string of spaced hex bytes in Big-Endian order.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="bytesToString(byte[],boolean,boolean,java.lang.String)">
<h3>bytesToString</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">bytesToString</span><wbr><span class="parameters">(byte[]&nbsp;arr,
boolean&nbsp;signed,
boolean&nbsp;littleEndian,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;sep)</span></div>
<div class="block">Returns a string view of a byte array</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>arr</code> - the given byte array</dd>
<dd><code>signed</code> - set true if you want the byte values signed.</dd>
<dd><code>littleEndian</code> - set true if you want Little-Endian order</dd>
<dd><code>sep</code> - the separator string between bytes</dd>
<dt>Returns:</dt>
<dd>a string view of a byte array</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="nanoSecToString(long)">
<h3>nanoSecToString</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">nanoSecToString</span><wbr><span class="parameters">(long&nbsp;nS)</span></div>
<div class="block">Returns the given time in nanoseconds formatted as Sec.mSec_uSec_nSec</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>nS</code> - the given nanoseconds</dd>
<dt>Returns:</dt>
<dd>the given time in nanoseconds formatted as Sec.mSec_uSec_nSec</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="milliSecToString(long)">
<h3>milliSecToString</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">milliSecToString</span><wbr><span class="parameters">(long&nbsp;mS)</span></div>
<div class="block">Returns the given time in milliseconds formatted as Hours:Min:Sec.mSec</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>mS</code> - the given milliseconds</dd>
<dt>Returns:</dt>
<dd>the given time in milliseconds formatted as Hours:Min:Sec.mSec</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="zeroPad(java.lang.String,int)">
<h3>zeroPad</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">zeroPad</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;s,
int&nbsp;fieldLength)</span></div>
<div class="block">Prepend the given string with zeros. If the given string is equal or greater than the given
field length, it will be returned without modification.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>s</code> - the given string</dd>
<dd><code>fieldLength</code> - desired total field length including the given string</dd>
<dt>Returns:</dt>
<dd>the given string prepended with zeros.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="characterPad(java.lang.String,int,char,boolean)">
<h3>characterPad</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">characterPad</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;s,
int&nbsp;fieldLength,
char&nbsp;padChar,
boolean&nbsp;postpend)</span></div>
<div class="block">Prepend or postpend the given string with the given character to fill the given field length.
If the given string is equal to or greater than the given field length, it will be returned
without modification.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>s</code> - the given string</dd>
<dd><code>fieldLength</code> - the desired field length</dd>
<dd><code>padChar</code> - the desired pad character</dd>
<dd><code>postpend</code> - if true append the pacCharacters to the end of the string.</dd>
<dt>Returns:</dt>
<dd>prepended or postpended given string with the given character to fill the given field length.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="checkIfMultipleOf8AndGT0(long,java.lang.String)">
<h3>checkIfMultipleOf8AndGT0</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkIfMultipleOf8AndGT0</span><wbr><span class="parameters">(long&nbsp;v,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;argName)</span></div>
<div class="block">Checks if parameter v is a multiple of 8 and greater than zero.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>v</code> - The parameter to check</dd>
<dd><code>argName</code> - This name will be part of the error message if the check fails.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="isMultipleOf8AndGT0(long)">
<h3>isMultipleOf8AndGT0</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isMultipleOf8AndGT0</span><wbr><span class="parameters">(long&nbsp;v)</span></div>
<div class="block">Returns true if v is a multiple of 8 and greater than zero</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>v</code> - The parameter to check</dd>
<dt>Returns:</dt>
<dd>true if v is a multiple of 8 and greater than zero</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="isPowerOf2(long)">
<h3>isPowerOf2</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isPowerOf2</span><wbr><span class="parameters">(long&nbsp;n)</span></div>
<div class="block">Returns true if given long argument is exactly a positive power of 2.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>n</code> - The input argument.</dd>
<dt>Returns:</dt>
<dd>true if argument is exactly a positive power of 2.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="checkIfPowerOf2(long,java.lang.String)">
<h3>checkIfPowerOf2</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkIfPowerOf2</span><wbr><span class="parameters">(long&nbsp;n,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;argName)</span></div>
<div class="block">Checks the given long argument if it is a positive integer power of 2.
If not, it throws an exception with the user supplied local argument name, if not null.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>n</code> - The input long argument must be a positive integer power of 2.</dd>
<dd><code>argName</code> - Used in the thrown exception. It may be null.</dd>
<dt>Throws:</dt>
<dd><code><a href="SketchesArgumentException.html" title="class in org.apache.datasketches.common">SketchesArgumentException</a></code> - if not a positive integer power of 2.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="ceilingPowerOf2(int)">
<h3>ceilingPowerOf2</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">ceilingPowerOf2</span><wbr><span class="parameters">(int&nbsp;n)</span></div>
<div class="block">Computes the int ceiling power of 2 within the range [1, 2^30]. This is the smallest positive power
of 2 that is equal to or greater than the given n and a positive integer.
<p>For:
<ul>
<li>n &le; 1: returns 1</li>
<li>2^30 &le; n &le; 2^31 -1 : returns 2^30</li>
<li>n == an exact power of 2 : returns n</li>
<li>otherwise returns the smallest power of 2 &ge; n and equal to a positive integer</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>n</code> - The input int argument.</dd>
<dt>Returns:</dt>
<dd>the ceiling power of 2.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="ceilingPowerOf2(long)">
<h3>ceilingPowerOf2</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">ceilingPowerOf2</span><wbr><span class="parameters">(long&nbsp;n)</span></div>
<div class="block">Computes the long ceiling power of 2 within the range [1, 2^62]. This is the smallest positive power
of 2 that is equal to or greater than the given n and a positive long.
<p>For:
<ul>
<li>n &le; 1: returns 1</li>
<li>2^62 &le; n &le; 2^63 -1 : returns 2^62</li>
<li>n == an exact power of 2 : returns n</li>
<li>otherwise returns the smallest power of 2 &ge; n and equal to a positive long</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>n</code> - The input long argument.</dd>
<dt>Returns:</dt>
<dd>the ceiling power of 2.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="floorPowerOf2(int)">
<h3>floorPowerOf2</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">floorPowerOf2</span><wbr><span class="parameters">(int&nbsp;n)</span></div>
<div class="block">Computes the floor power of 2 given <i>n</i> is in the range [1, 2^31-1].
This is the largest positive power of 2 that equal to or less than the given n and equal
to a positive integer.
<p>For:
<ul>
<li>n &le; 1: returns 1</li>
<li>2^30 &le; n &le; 2^31 -1 : returns 2^30</li>
<li>n == a power of 2 : returns n</li>
<li>otherwise returns the largest power of 2 less than n and equal to a mathematical
integer.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>n</code> - The given int argument.</dd>
<dt>Returns:</dt>
<dd>the floor power of 2 as an int.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="floorPowerOf2(long)">
<h3>floorPowerOf2</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">floorPowerOf2</span><wbr><span class="parameters">(long&nbsp;n)</span></div>
<div class="block">Computes the floor power of 2 given <i>n</i> is in the range [1, 2^63-1].
This is the largest positive power of 2 that is equal to or less than the given <i>n</i> and
equal to a positive integer.
<p>For:
<ul>
<li>n &le; 1: returns 1</li>
<li>2^62 &le; n &le; 2^63 -1 : returns 2^62</li>
<li>n == a power of 2 : returns n</li>
<li>otherwise returns the largest power of 2 less than n and equal to a mathematical
integer.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>n</code> - The given long argument.</dd>
<dt>Returns:</dt>
<dd>the floor power of 2 as a long</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="ceilingMultiple2expK(long,int)">
<h3>ceilingMultiple2expK</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">ceilingMultiple2expK</span><wbr><span class="parameters">(long&nbsp;n,
int&nbsp;k)</span></div>
<div class="block">This is a long integer equivalent to <i>Math.ceil(n / (double)(1 &lt;&lt; k))</i>
where: <i>0 &lt; k &le; 6</i> and <i>n</i> is a non-negative long.
These limits are not checked for speed reasons.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>n</code> - the input dividend as a positive long greater than zero.</dd>
<dd><code>k</code> - the input divisor exponent of 2 as a positive integer where 0 &lt; k &le; 6.</dd>
<dt>Returns:</dt>
<dd>the long integer equivalent to <i>Math.ceil(n / 2^k)</i>.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="invPow2(int)">
<h3>invPow2</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">invPow2</span><wbr><span class="parameters">(int&nbsp;e)</span></div>
<div class="block">Computes the inverse integer power of 2: 1/(2^e) = 2^(-e).</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>e</code> - a positive value between 0 and 1023 inclusive</dd>
<dt>Returns:</dt>
<dd>the inverse integer power of 2: 1/(2^e) = 2^(-e)</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="pwr2SeriesNext(int,long)">
<h3>pwr2SeriesNext</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">pwr2SeriesNext</span><wbr><span class="parameters">(int&nbsp;ppo,
long&nbsp;curPoint)</span></div>
<div class="block">Computes the next larger integer point in the power series
<i>point = 2<sup>( i / ppo )</sup></i> given the current point in the series.
For illustration, this can be used in a loop as follows:
<pre><code> int maxP = 1024;
int minP = 1;
int ppo = 2;
for (int p = minP; p &lt;= maxP; p = pwr2SeriesNext(ppo, p)) {
System.out.print(p + " ");
}
//generates the following series:
//1 2 3 4 6 8 11 16 23 32 45 64 91 128 181 256 362 512 724 1024
</code></pre></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>ppo</code> - Points-Per-Octave, or the number of points per integer powers of 2 in the series.</dd>
<dd><code>curPoint</code> - the current point of the series. Must be &ge; 1.</dd>
<dt>Returns:</dt>
<dd>the next point in the power series.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="pwr2SeriesPrev(int,int)">
<h3>pwr2SeriesPrev</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">pwr2SeriesPrev</span><wbr><span class="parameters">(int&nbsp;ppo,
int&nbsp;curPoint)</span></div>
<div class="block">Computes the previous, smaller integer point in the power series
<i>point = 2<sup>( i / ppo )</sup></i> given the current point in the series.
For illustration, this can be used in a loop as follows:
<pre><code> int maxP = 1024;
int minP = 1;
int ppo = 2;
for (int p = maxP; p &gt;= minP; p = pwr2SeriesPrev(ppo, p)) {
System.out.print(p + " ");
}
//generates the following series:
//1024 724 512 362 256 181 128 91 64 45 32 23 16 11 8 6 4 3 2 1
</code></pre></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>ppo</code> - Points-Per-Octave, or the number of points per integer powers of 2 in the series.</dd>
<dd><code>curPoint</code> - the current point of the series. Must be &ge; 1.</dd>
<dt>Returns:</dt>
<dd>the previous, smaller point in the power series.
A returned value of zero terminates the series.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="powerSeriesNextDouble(int,double,boolean,double)">
<h3>powerSeriesNextDouble</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">powerSeriesNextDouble</span><wbr><span class="parameters">(int&nbsp;ppb,
double&nbsp;curPoint,
boolean&nbsp;roundToLong,
double&nbsp;logBase)</span></div>
<div class="block">Computes the next larger double in the power series
<i>point = logBase<sup>( i / ppb )</sup></i> given the current point in the series.
For illustration, this can be used in a loop as follows:
<pre><code> double maxP = 1024.0;
double minP = 1.0;
int ppb = 2;
double logBase = 2.0;
for (double p = minP; p &lt;= maxP; p = powerSeriesNextDouble(ppb, p, true, logBase)) {
System.out.print(p + " ");
}
//generates the following series:
//1 2 3 4 6 8 11 16 23 32 45 64 91 128 181 256 362 512 724 1024
</code></pre></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>ppb</code> - Points-Per-Base, or the number of points per integer powers of base in the series.</dd>
<dd><code>curPoint</code> - the current point of the series. Must be &ge; 1.0.</dd>
<dd><code>roundToLong</code> - if true the output will be rounded to the nearest long.</dd>
<dd><code>logBase</code> - the desired base of the logarithms</dd>
<dt>Returns:</dt>
<dd>the next point in the power series.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="ceilingPowerBaseOfDouble(double,double)">
<h3>ceilingPowerBaseOfDouble</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">ceilingPowerBaseOfDouble</span><wbr><span class="parameters">(double&nbsp;base,
double&nbsp;n)</span></div>
<div class="block">Returns the ceiling of a given <i>n</i> given a <i>base</i>, where the ceiling is an integral power of the base.
This is the smallest positive power of <i>base</i> that is equal to or greater than the given <i>n</i>
and equal to a mathematical integer.
The result of this function is consistent with <a href="#ceilingPowerOf2(int)"><code>ceilingPowerOf2(int)</code></a> for values
less than one. I.e., if <i>n &lt; 1,</i> the result is 1.
<p>The formula is: <i>base<sup>ceiling(log<sub>base</sub>(x))</sup></i></p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>base</code> - The number in the expression &#8968;base<sup>n</sup>&#8969;.</dd>
<dd><code>n</code> - The input argument.</dd>
<dt>Returns:</dt>
<dd>the ceiling power of <i>base</i> as a double and equal to a mathematical integer.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="floorPowerBaseOfDouble(double,double)">
<h3>floorPowerBaseOfDouble</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">floorPowerBaseOfDouble</span><wbr><span class="parameters">(double&nbsp;base,
double&nbsp;n)</span></div>
<div class="block">Computes the floor of a given <i>n</i> given <i>base</i>, where the floor is an integral power of the base.
This is the largest positive power of <i>base</i> that is equal to or less than the given <i>n</i>
and equal to a mathematical integer.
The result of this function is consistent with <a href="#floorPowerOf2(int)"><code>floorPowerOf2(int)</code></a> for values
less than one. I.e., if <i>n &lt; 1,</i> the result is 1.
<p>The formula is: <i>base<sup>floor(log<sub>base</sub>(x))</sup></i></p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>base</code> - The number in the expression &#8970;base<sup>n</sup>&#8971;.</dd>
<dd><code>n</code> - The input argument.</dd>
<dt>Returns:</dt>
<dd>the floor power of 2 and equal to a mathematical integer.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="log2(double)">
<h3>log2</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">log2</span><wbr><span class="parameters">(double&nbsp;value)</span></div>
<div class="block">The log<sub>2</sub>(value)</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - the given value</dd>
<dt>Returns:</dt>
<dd>log<sub>2</sub>(value)</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="logBaseOfX(double,double)">
<h3>logBaseOfX</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">logBaseOfX</span><wbr><span class="parameters">(double&nbsp;base,
double&nbsp;x)</span></div>
<div class="block">Returns the log<sub>base</sub>(x). Example, if base = 2.0: logB(2.0, x) = log(x) / log(2.0).</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>base</code> - The number in the expression log(x) / log(base).</dd>
<dd><code>x</code> - the given value</dd>
<dt>Returns:</dt>
<dd>the log<sub>base</sub>(x)</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="numberOfTrailingOnes(long)">
<h3>numberOfTrailingOnes</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">numberOfTrailingOnes</span><wbr><span class="parameters">(long&nbsp;v)</span></div>
<div class="block">Returns the number of one bits following the lowest-order ("rightmost") zero-bit in the
two's complement binary representation of the specified long value, or 64 if the value is equal
to minus one.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>v</code> - the value whose number of trailing ones is to be computed.</dd>
<dt>Returns:</dt>
<dd>the number of one bits following the lowest-order ("rightmost") zero-bit in the
two's complement binary representation of the specified long value, or 64 if the value is equal
to minus one.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="numberOfLeadingOnes(long)">
<h3>numberOfLeadingOnes</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">numberOfLeadingOnes</span><wbr><span class="parameters">(long&nbsp;v)</span></div>
<div class="block">Returns the number of one bits preceding the highest-order ("leftmost") zero-bit in the
two's complement binary representation of the specified long value, or 64 if the value is equal
to minus one.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>v</code> - the value whose number of leading ones is to be computed.</dd>
<dt>Returns:</dt>
<dd>the number of one bits preceding the lowest-order ("rightmost") zero-bit in the
two's complement binary representation of the specified long value, or 64 if the value is equal
to minus one.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="exactLog2OfInt(int,java.lang.String)">
<h3>exactLog2OfInt</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">exactLog2OfInt</span><wbr><span class="parameters">(int&nbsp;powerOf2,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;argName)</span></div>
<div class="block">Returns the log2 of the given int value if it is an exact power of 2 and greater than zero.
If not, it throws an exception with the user supplied local argument name.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>powerOf2</code> - must be a power of 2 and greater than zero.</dd>
<dd><code>argName</code> - the argument name used in the exception if thrown.</dd>
<dt>Returns:</dt>
<dd>the log2 of the given value if it is an exact power of 2 and greater than zero.</dd>
<dt>Throws:</dt>
<dd><code><a href="SketchesArgumentException.html" title="class in org.apache.datasketches.common">SketchesArgumentException</a></code> - if not a power of 2 nor greater than zero.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="exactLog2OfLong(long,java.lang.String)">
<h3>exactLog2OfLong</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">exactLog2OfLong</span><wbr><span class="parameters">(long&nbsp;powerOf2,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;argName)</span></div>
<div class="block">Returns the log2 of the given long value if it is an exact power of 2 and greater than zero.
If not, it throws an exception with the user supplied local argument name.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>powerOf2</code> - must be a power of 2 and greater than zero.</dd>
<dd><code>argName</code> - the argument name used in the exception if thrown.</dd>
<dt>Returns:</dt>
<dd>the log2 of the given value if it is an exact power of 2 and greater than zero.</dd>
<dt>Throws:</dt>
<dd><code><a href="SketchesArgumentException.html" title="class in org.apache.datasketches.common">SketchesArgumentException</a></code> - if not a power of 2 nor greater than zero.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="exactLog2OfInt(int)">
<h3>exactLog2OfInt</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">exactLog2OfInt</span><wbr><span class="parameters">(int&nbsp;powerOf2)</span></div>
<div class="block">Returns the log2 of the given int value if it is an exact power of 2 and greater than zero.
If not, it throws an exception.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>powerOf2</code> - must be a power of 2 and greater than zero.</dd>
<dt>Returns:</dt>
<dd>the log2 of the given int value if it is an exact power of 2 and greater than zero.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="exactLog2OfLong(long)">
<h3>exactLog2OfLong</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">exactLog2OfLong</span><wbr><span class="parameters">(long&nbsp;powerOf2)</span></div>
<div class="block">Returns the log2 of the given long value if it is an exact power of 2 and greater than zero.
If not, it throws an exception.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>powerOf2</code> - must be a power of 2 and greater than zero.</dd>
<dt>Returns:</dt>
<dd>the log2 of the given long value if it is an exact power of 2 and greater than zero.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="checkBounds(long,long,long)">
<h3>checkBounds</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkBounds</span><wbr><span class="parameters">(long&nbsp;reqOff,
long&nbsp;reqLen,
long&nbsp;allocSize)</span></div>
<div class="block">Check the requested offset and length against the allocated size.
The invariants equation is: <code>0 &lt;= reqOff &lt;= reqLen &lt;= reqOff + reqLen &lt;= allocSize</code>.
If this equation is violated an <a href="SketchesArgumentException.html" title="class in org.apache.datasketches.common"><code>SketchesArgumentException</code></a> will be thrown.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>reqOff</code> - the requested offset</dd>
<dd><code>reqLen</code> - the requested length</dd>
<dd><code>allocSize</code> - the allocated size.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="checkProbability(double,java.lang.String)">
<h3>checkProbability</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkProbability</span><wbr><span class="parameters">(double&nbsp;p,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;argName)</span></div>
<div class="block">Checks the given parameter to make sure it is positive and between 0.0 inclusive and 1.0
inclusive.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>p</code> - <a href="../../../../resources/dictionary.html#p">See Sampling Probability, <i>p</i></a></dd>
<dd><code>argName</code> - Used in the thrown exception.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="isLessThanUnsigned(long,long)">
<h3>isLessThanUnsigned</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isLessThanUnsigned</span><wbr><span class="parameters">(long&nbsp;n1,
long&nbsp;n2)</span></div>
<div class="block">Unsigned compare with longs.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>n1</code> - A long to be treated as if unsigned.</dd>
<dd><code>n2</code> - A long to be treated as if unsigned.</dd>
<dt>Returns:</dt>
<dd>true if n1 &gt; n2.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="isEven(long)">
<h3>isEven</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isEven</span><wbr><span class="parameters">(long&nbsp;n)</span></div>
<div class="block">Returns true if given n is even.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>n</code> - the given n</dd>
<dt>Returns:</dt>
<dd>true if given n is even.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="isOdd(long)">
<h3>isOdd</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isOdd</span><wbr><span class="parameters">(long&nbsp;n)</span></div>
<div class="block">Returns true if given n is odd.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>n</code> - the given n</dd>
<dt>Returns:</dt>
<dd>true if given n is odd.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="bitAt(long,int)">
<h3>bitAt</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">bitAt</span><wbr><span class="parameters">(long&nbsp;number,
int&nbsp;bitPos)</span></div>
<div class="block">Returns a one if the bit at bitPos is a one, otherwise zero.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>number</code> - the number to examine</dd>
<dd><code>bitPos</code> - the given zero-based bit position, where the least significant
bit is at position zero.</dd>
<dt>Returns:</dt>
<dd>a one if the bit at bitPos is a one, otherwise zero.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="numDigits(long)">
<h3>numDigits</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">numDigits</span><wbr><span class="parameters">(long&nbsp;n)</span></div>
<div class="block">Computes the number of decimal digits of the number n</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>n</code> - the given number</dd>
<dt>Returns:</dt>
<dd>the number of decimal digits of the number n</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="longToFixedLengthString(long,int)">
<h3>longToFixedLengthString</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">longToFixedLengthString</span><wbr><span class="parameters">(long&nbsp;number,
int&nbsp;length)</span></div>
<div class="block">Converts the given number to a string prepended with spaces, if necessary, to
match the given length.
<p>For example, assume a sequence of integers from 1 to 1000. The largest value has
four decimal digits. Convert the entire sequence of strings to the form " 1" to "1000".
When these strings are sorted they will be in numerical sequence: " 1", " 2", ... "1000".</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>number</code> - the given number</dd>
<dd><code>length</code> - the desired string length.</dd>
<dt>Returns:</dt>
<dd>the given number to a string prepended with spaces</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="minT(java.lang.Object,java.lang.Object,java.util.Comparator)">
<h3>minT</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="type-parameters">&lt;T&gt;</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span>&nbsp;<span class="element-name">minT</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item1,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item2,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Comparator.html" title="class or interface in java.util" class="external-link">Comparator</a>&lt;? super T&gt;&nbsp;c)</span></div>
<div class="block">Finds the minimum of two generic items</div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><span id="minT(java.lang.Object,java.lang.Object,java.util.Comparator)-type-param-T"><code>T</code> - the type</span></dd>
<dt>Parameters:</dt>
<dd><code>item1</code> - item one</dd>
<dd><code>item2</code> - item two</dd>
<dd><code>c</code> - the given comparator</dd>
<dt>Returns:</dt>
<dd>the minimum value</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="maxT(java.lang.Object,java.lang.Object,java.util.Comparator)">
<h3>maxT</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="type-parameters">&lt;T&gt;</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span>&nbsp;<span class="element-name">maxT</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item1,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item2,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Comparator.html" title="class or interface in java.util" class="external-link">Comparator</a>&lt;? super T&gt;&nbsp;c)</span></div>
<div class="block">Finds the maximum of two generic items</div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><span id="maxT(java.lang.Object,java.lang.Object,java.util.Comparator)-type-param-T"><code>T</code> - the type</span></dd>
<dt>Parameters:</dt>
<dd><code>item1</code> - item one</dd>
<dd><code>item2</code> - item two</dd>
<dd><code>c</code> - the given comparator</dd>
<dt>Returns:</dt>
<dd>the maximum value</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="lt(java.lang.Object,java.lang.Object,java.util.Comparator)">
<h3>lt</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="type-parameters">&lt;T&gt;</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">lt</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item1,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item2,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Comparator.html" title="class or interface in java.util" class="external-link">Comparator</a>&lt;? super T&gt;&nbsp;c)</span></div>
<div class="block">Is item1 Less-Than item2?</div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><span id="lt(java.lang.Object,java.lang.Object,java.util.Comparator)-type-param-T"><code>T</code> - the type</span></dd>
<dt>Parameters:</dt>
<dd><code>item1</code> - item one</dd>
<dd><code>item2</code> - item two</dd>
<dd><code>c</code> - the given comparator</dd>
<dt>Returns:</dt>
<dd>true if item1 Less-Than item2</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="le(java.lang.Object,java.lang.Object,java.util.Comparator)">
<h3>le</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="type-parameters">&lt;T&gt;</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">le</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item1,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;item2,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Comparator.html" title="class or interface in java.util" class="external-link">Comparator</a>&lt;? super T&gt;&nbsp;c)</span></div>
<div class="block">Is item1 Less-Than-Or-Equal-To item2?</div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><span id="le(java.lang.Object,java.lang.Object,java.util.Comparator)-type-param-T"><code>T</code> - the type</span></dd>
<dt>Parameters:</dt>
<dd><code>item1</code> - item one</dd>
<dd><code>item2</code> - item two</dd>
<dd><code>c</code> - the given comparator</dd>
<dt>Returns:</dt>
<dd>true if item1 Less-Than-Or-Equal-To item2</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="clear(java.lang.foreign.MemorySegment)">
<h3>clear</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">clear</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg)</span></div>
<div class="block">Clears all bytes of this MemorySegment to zero.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>seg</code> - the given MemorySegment</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="clear(java.lang.foreign.MemorySegment,long,long)">
<h3>clear</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">clear</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg,
long&nbsp;offsetBytes,
long&nbsp;lengthBytes)</span></div>
<div class="block">Clears a portion of this MemorySegment to zero.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>seg</code> - the given MemorySegment</dd>
<dd><code>offsetBytes</code> - offset bytes relative to this MemorySegment start</dd>
<dd><code>lengthBytes</code> - the length in bytes</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="clearBits(java.lang.foreign.MemorySegment,long,byte)">
<h3>clearBits</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">clearBits</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg,
long&nbsp;offsetBytes,
byte&nbsp;bitMask)</span></div>
<div class="block">Clears the bits defined by the bitMask</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>seg</code> - the given MemorySegment</dd>
<dd><code>offsetBytes</code> - offset bytes relative to this Memory start.</dd>
<dd><code>bitMask</code> - the bits set to one will be cleared</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="equalContents(java.lang.foreign.MemorySegment,java.lang.foreign.MemorySegment)">
<h3>equalContents</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">equalContents</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg1,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg2)</span></div>
<div class="block">Returns true if both segments have the same contents and the same length.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>seg1</code> - the given MemorySegment #1</dd>
<dd><code>seg2</code> - the given MemorySegment #2</dd>
<dt>Returns:</dt>
<dd>true if both segments have the same contents and the same length.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="equalContents(java.lang.foreign.MemorySegment,long,java.lang.foreign.MemorySegment,long,long)">
<h3>equalContents</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">equalContents</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg1,
long&nbsp;seg1offsetBytes,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg2,
long&nbsp;seg2offsetBytes,
long&nbsp;lengthBytes)</span></div>
<div class="block">Returns true if both segments have the same content for the specified region.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>seg1</code> - the given MemorySegment #1</dd>
<dd><code>seg1offsetBytes</code> - the starting offset for MemorySegment #1 in bytes.</dd>
<dd><code>seg2</code> - the given MemorySegment #2</dd>
<dd><code>seg2offsetBytes</code> - the starting offset for MemorySegment #2 in bytes.</dd>
<dd><code>lengthBytes</code> - the length of the region to be compared, in bytes.</dd>
<dt>Returns:</dt>
<dd>true, if both segments have the content for the specified region.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="fill(java.lang.foreign.MemorySegment,long,long,byte)">
<h3>fill</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">fill</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg,
long&nbsp;offsetBytes,
long&nbsp;lengthBytes,
byte&nbsp;value)</span></div>
<div class="block">Fills a portion of this Memory region to the given byte value.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>seg</code> - the given MemorySegment</dd>
<dd><code>offsetBytes</code> - offset bytes relative to this Memory start</dd>
<dd><code>lengthBytes</code> - the length in bytes</dd>
<dd><code>value</code> - the given byte value</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="alignedHeapSegment(int,boolean)">
<h3>alignedHeapSegment</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a></span>&nbsp;<span class="element-name">alignedHeapSegment</span><wbr><span class="parameters">(int&nbsp;capacityBytes,
boolean&nbsp;aligned)</span></div>
<div class="block">Request a new heap MemorySegment with the given capacityBytes and either 8-byte aligned or one byte aligned.
<p>If <i>aligned</i> is true, the returned MemorySegment will be constructed from a <i>long[]</i> array,
and, as a result, it will have a memory alignment of 8 bytes.
If the requested capacity is not exactly divisible by eight, the returned size
will be rolled up to the next multiple of eight bytes.</p>
<p>If <i>aligned</i> is false, the returned MemorySegment will be constructed from a <i>byte[]</i> array,
and have a memory alignment of 1 byte.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>capacityBytes</code> - The new capacity being requested. It must not be negative and cannot exceed Integer.MAX_VALUE.</dd>
<dd><code>aligned</code> - if true, the new heap segment will have an alignment of 8 bytes, otherwise the alignment will be 1 byte.</dd>
<dt>Returns:</dt>
<dd>a new MemorySegment with the requested capacity and alignment.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="setBits(java.lang.foreign.MemorySegment,long,byte)">
<h3>setBits</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setBits</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/MemorySegment.html" title="class or interface in java.lang.foreign" class="external-link">MemorySegment</a>&nbsp;seg,
long&nbsp;offsetBytes,
byte&nbsp;bitMask)</span></div>
<div class="block">Sets the bits defined by the bitMask</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>seg</code> - the given MemorySegment</dd>
<dd><code>offsetBytes</code> - offset bytes relative to this MemorySegment start</dd>
<dd><code>bitMask</code> - the bits set to one will be set</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="computeSeedHash(long)">
<h3>computeSeedHash</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">short</span>&nbsp;<span class="element-name">computeSeedHash</span><wbr><span class="parameters">(long&nbsp;seed)</span></div>
<div class="block">Computes and checks the 16-bit seed hash from the given long seed.
The seed hash may not be zero in order to maintain compatibility with older serialized
versions that did not have this concept.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>seed</code> - <a href="../../../../resources/dictionary.html#seed">See Update Hash Seed</a></dd>
<dt>Returns:</dt>
<dd>the seed hash.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="checkSeedHashes(short,short)">
<h3>checkSeedHashes</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">short</span>&nbsp;<span class="element-name">checkSeedHashes</span><wbr><span class="parameters">(short&nbsp;seedHashA,
short&nbsp;seedHashB)</span></div>
<div class="block">Check if the two seed hashes are equal. If not, throw an SketchesArgumentException.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>seedHashA</code> - the seedHash A</dd>
<dd><code>seedHashB</code> - the seedHash B</dd>
<dt>Returns:</dt>
<dd>seedHashA if they are equal</dd>
</dl>
</div>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2015&#x2013;2025 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</main>
</div>
</body>
</html>