Skip to content

Commit 2019e3b

Browse files
committed
Update artifacts
1 parent 56d5636 commit 2019e3b

File tree

4 files changed

+49
-70
lines changed

4 files changed

+49
-70
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[213,231,92.2078,27,33,81.8182,1,1,100,213,231,92.2078,"801ea94b6a45eccb7ec841b2428aa58d052276cf","2025-11-27 02:09:49 -0800"]
1+
[206,224,91.9643,25,31,80.6452,1,1,100,206,224,91.9643,"6d5781c66d0094690c3574279bd5e1d112f738c1","2025-12-02 14:40:05 +0530"]

number/float16/base/to-word/index.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ <h1>All files</h1>
2323
<div class='clearfix'>
2424

2525
<div class='fl pad1y space-right2'>
26-
<span class="strong">92.2% </span>
26+
<span class="strong">91.96% </span>
2727
<span class="quiet">Statements</span>
28-
<span class='fraction'>213/231</span>
28+
<span class='fraction'>206/224</span>
2929
</div>
3030

3131

3232
<div class='fl pad1y space-right2'>
33-
<span class="strong">81.81% </span>
33+
<span class="strong">80.64% </span>
3434
<span class="quiet">Branches</span>
35-
<span class='fraction'>27/33</span>
35+
<span class='fraction'>25/31</span>
3636
</div>
3737

3838

@@ -44,9 +44,9 @@ <h1>All files</h1>
4444

4545

4646
<div class='fl pad1y space-right2'>
47-
<span class="strong">92.2% </span>
47+
<span class="strong">91.96% </span>
4848
<span class="quiet">Lines</span>
49-
<span class='fraction'>213/231</span>
49+
<span class='fraction'>206/224</span>
5050
</div>
5151

5252

@@ -95,17 +95,17 @@ <h1>All files</h1>
9595

9696
<tr>
9797
<td class="file high" data-value="main.js"><a href="main.js.html">main.js</a></td>
98-
<td data-value="90.37" class="pic high">
98+
<td data-value="90" class="pic high">
9999
<div class="chart"><div class="cover-fill" style="width: 90%"></div><div class="cover-empty" style="width: 10%"></div></div>
100100
</td>
101-
<td data-value="90.37" class="pct high">90.37%</td>
102-
<td data-value="187" class="abs high">169/187</td>
103-
<td data-value="81.25" class="pct high">81.25%</td>
104-
<td data-value="32" class="abs high">26/32</td>
101+
<td data-value="90" class="pct high">90%</td>
102+
<td data-value="180" class="abs high">162/180</td>
103+
<td data-value="80" class="pct high">80%</td>
104+
<td data-value="30" class="abs high">24/30</td>
105105
<td data-value="100" class="pct high">100%</td>
106106
<td data-value="1" class="abs high">1/1</td>
107-
<td data-value="90.37" class="pct high">90.37%</td>
108-
<td data-value="187" class="abs high">169/187</td>
107+
<td data-value="90" class="pct high">90%</td>
108+
<td data-value="180" class="abs high">162/180</td>
109109
</tr>
110110

111111
</tbody>
@@ -116,7 +116,7 @@ <h1>All files</h1>
116116
<div class='footer quiet pad2 space-top1 center small'>
117117
Code coverage generated by
118118
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119-
at 2025-11-27T10:10:54.218Z
119+
at 2025-12-02T09:11:57.970Z
120120
</div>
121121
<script src="prettify.js"></script>
122122
<script>

number/float16/base/to-word/index.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ <h1><a href="index.html">All files</a> index.js</h1>
202202
<div class='footer quiet pad2 space-top1 center small'>
203203
Code coverage generated by
204204
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
205-
at 2025-11-27T10:10:54.218Z
205+
at 2025-12-02T09:11:57.970Z
206206
</div>
207207
<script src="prettify.js"></script>
208208
<script>

number/float16/base/to-word/main.js.html

Lines changed: 33 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ <h1><a href="index.html">All files</a> main.js</h1>
2323
<div class='clearfix'>
2424

2525
<div class='fl pad1y space-right2'>
26-
<span class="strong">90.37% </span>
26+
<span class="strong">90% </span>
2727
<span class="quiet">Statements</span>
28-
<span class='fraction'>169/187</span>
28+
<span class='fraction'>162/180</span>
2929
</div>
3030

3131

3232
<div class='fl pad1y space-right2'>
33-
<span class="strong">81.25% </span>
33+
<span class="strong">80% </span>
3434
<span class="quiet">Branches</span>
35-
<span class='fraction'>26/32</span>
35+
<span class='fraction'>24/30</span>
3636
</div>
3737

3838

@@ -44,9 +44,9 @@ <h1><a href="index.html">All files</a> main.js</h1>
4444

4545

4646
<div class='fl pad1y space-right2'>
47-
<span class="strong">90.37% </span>
47+
<span class="strong">90% </span>
4848
<span class="quiet">Lines</span>
49-
<span class='fraction'>169/187</span>
49+
<span class='fraction'>162/180</span>
5050
</div>
5151

5252

@@ -243,14 +243,7 @@ <h1><a href="index.html">All files</a> main.js</h1>
243243
<a name='L178'></a><a href='#L178'>178</a>
244244
<a name='L179'></a><a href='#L179'>179</a>
245245
<a name='L180'></a><a href='#L180'>180</a>
246-
<a name='L181'></a><a href='#L181'>181</a>
247-
<a name='L182'></a><a href='#L182'>182</a>
248-
<a name='L183'></a><a href='#L183'>183</a>
249-
<a name='L184'></a><a href='#L184'>184</a>
250-
<a name='L185'></a><a href='#L185'>185</a>
251-
<a name='L186'></a><a href='#L186'>186</a>
252-
<a name='L187'></a><a href='#L187'>187</a>
253-
<a name='L188'></a><a href='#L188'>188</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
246+
<a name='L181'></a><a href='#L181'>181</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
254247
<span class="cline-any cline-yes">1x</span>
255248
<span class="cline-any cline-yes">1x</span>
256249
<span class="cline-any cline-yes">1x</span>
@@ -311,9 +304,6 @@ <h1><a href="index.html">All files</a> main.js</h1>
311304
<span class="cline-any cline-yes">5005x</span>
312305
<span class="cline-any cline-yes">5005x</span>
313306
<span class="cline-any cline-yes">5005x</span>
314-
<span class="cline-any cline-yes">5005x</span>
315-
<span class="cline-any cline-yes">5005x</span>
316-
<span class="cline-any cline-yes">5005x</span>
317307
<span class="cline-any cline-yes">1x</span>
318308
<span class="cline-any cline-yes">1x</span>
319309
<span class="cline-any cline-yes">5005x</span>
@@ -346,10 +336,6 @@ <h1><a href="index.html">All files</a> main.js</h1>
346336
<span class="cline-any cline-yes">4996x</span>
347337
<span class="cline-any cline-yes">4996x</span>
348338
<span class="cline-any cline-yes">4996x</span>
349-
<span class="cline-any cline-yes">4996x</span>
350-
<span class="cline-any cline-yes">4996x</span>
351-
<span class="cline-any cline-yes">4996x</span>
352-
<span class="cline-any cline-yes">4996x</span>
353339
<span class="cline-any cline-yes">5005x</span>
354340
<span class="cline-any cline-no">&nbsp;</span>
355341
<span class="cline-any cline-no">&nbsp;</span>
@@ -408,9 +394,9 @@ <h1><a href="index.html">All files</a> main.js</h1>
408394
<span class="cline-any cline-yes">3996x</span>
409395
<span class="cline-any cline-yes">3996x</span>
410396
<span class="cline-any cline-yes">3996x</span>
411-
<span class="cline-any cline-yes">5005x</span>
412-
<span class="cline-any cline-yes">5005x</span>
413-
<span class="cline-any cline-yes">5005x</span>
397+
<span class="cline-any cline-yes">3996x</span>
398+
<span class="cline-any cline-yes">3996x</span>
399+
<span class="cline-any cline-yes">3996x</span>
414400
<span class="cline-any cline-yes">5005x</span>
415401
<span class="cline-any cline-yes">1988x</span>
416402
<span class="cline-any cline-yes">1988x</span>
@@ -465,7 +451,7 @@ <h1><a href="index.html">All files</a> main.js</h1>
465451
var abs = require( '@stdlib/math/base/special/abs' );
466452
var exponent = require( '@stdlib/number/float64/base/exponent' );
467453
var isNegativeZero = require( '@stdlib/assert/is-negative-zero' );
468-
var toWords = require( '@stdlib/number/float64/base/to-words' );
454+
var toWordf = require( '@stdlib/number/float32/base/to-word' );
469455
&nbsp;
470456
&nbsp;
471457
// MAIN //
@@ -486,18 +472,15 @@ <h1><a href="index.html">All files</a> main.js</h1>
486472
* // returns 15411
487473
*/
488474
function toWord( x ) {
489-
var mantissaHigh;
490-
var mantissaLow;
491-
var f64Exponent;
475+
var f32Exponent;
492476
var f16Exponent;
493477
var stickyBits;
494478
var mantissa;
495479
var roundBit;
496480
var shift;
481+
var bits;
482+
var mant;
497483
var sign;
498-
var high;
499-
var low;
500-
var w;
501484
&nbsp;
502485
// Handle special cases
503486
if ( isnan( x ) ) { // NaN
@@ -522,19 +505,15 @@ <h1><a href="index.html">All files</a> main.js</h1>
522505
sign = 0;
523506
}
524507
x = abs( x );
508+
bits = toWordf( x );
525509
&nbsp;
526-
w = toWords( x );
527-
high = w[ 0 ]; // high 32 bits
528-
low = w[ 1 ]; // low 32 bits
529-
&nbsp;
530-
mantissaHigh = high &amp; 0xFFFFF; // 20 bits: mantissa[51:32]
531-
mantissaLow = low; // 32 bits: mantissa[31:0]
510+
mant = bits &amp; 0x7FFFFF; // 23-bit mantissa
532511
&nbsp;
533-
// Store unbiased exponent of a 64-bit floating-point number.
534-
f64Exponent = exponent( x );
512+
// Store unbiased exponent of a 32-bit floating-point number.
513+
f32Exponent = exponent( x );
535514
&nbsp;
536515
// Calculate exponent of a 16-bit floating-point number.
537-
f16Exponent = f64Exponent + 15;
516+
f16Exponent = f32Exponent + 15;
538517
&nbsp;
539518
// Handle overflow (infinity in float16)
540519
if ( f16Exponent &gt;= 31 ) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
@@ -554,8 +533,8 @@ <h1><a href="index.html">All files</a> main.js</h1>
554533
// Calculate the amount of right shift needed to denormalize the mantissa for subnormal representation:
555534
shift = 1 - f16Exponent;
556535
&nbsp;
557-
// Create an 11-bit mantissa by adding the implicit leading 1 bit and extracting the top 10 bits from mantissaHigh:
558-
mantissa = 0x400 | ( mantissaHigh &gt;&gt;&gt; 10 );
536+
// Create an 11-bit mantissa by adding the implicit leading 1 bit and extracting the top 10 bits from mantissa:
537+
mantissa = ( 0x800000 | mant ) &gt;&gt;&gt; 13;
559538
&nbsp;
560539
// Determine the round bit and sticky bits based on the shift amount to apply correct rounding:
561540
if ( shift &lt; 11 ) {
@@ -565,16 +544,16 @@ <h1><a href="index.html">All files</a> main.js</h1>
565544
// Check if any bits below the round bit position are set (sticky bits):
566545
stickyBits = ( mantissa &amp; ( ( 1 &lt;&lt; ( shift - 1 ) ) - 1 ) ) !== 0;
567546
&nbsp;
568-
// If no sticky bits found in the 11-bit mantissa, check the remaining bits from the original float64 mantissa:
547+
// If no sticky bits found in the 11-bit mantissa, check the remaining bits from the original mantissa:
569548
if ( !stickyBits ) {
570-
stickyBits = ( ( mantissaHigh &amp; 0x3FF ) !== 0 ) || ( mantissaLow !== 0 ); // eslint-disable-line max-len
549+
stickyBits = ( mant &amp; 0x1FFF ) !== 0;
571550
}
572551
}<span class="branch-0 cbranch-no" title="branch not covered" > else {</span>
573-
<span class="cstat-no" title="statement not covered" > // When the shift is 11 or greater, the round bit comes from the lower bits of mantissaHigh:</span>
574-
<span class="cstat-no" title="statement not covered" > roundBit = ( mantissaHigh &gt;&gt;&gt; ( 10 - ( shift - 11 ) - 1 ) ) &amp; 1;</span>
552+
<span class="cstat-no" title="statement not covered" > // When the shift is 11 or greater, the round bit comes from original mantissa</span>
553+
<span class="cstat-no" title="statement not covered" > roundBit = ( mant &gt;&gt;&gt; ( 13 - ( shift - 11 ) - 1 ) ) &amp; 1;</span>
575554
<span class="cstat-no" title="statement not covered" ></span>
576-
<span class="cstat-no" title="statement not covered" > // Check if any bits below the round bit position in mantissaHigh or any bits in mantissaLow are set:</span>
577-
<span class="cstat-no" title="statement not covered" > stickyBits = ( ( mantissaHigh &amp; ( ( 1 &lt;&lt; ( 10 - ( shift - 11 ) - 1 ) ) - 1 ) ) !== 0 ) || ( mantissaLow !== 0 ); // eslint-disable-line max-len</span>
555+
<span class="cstat-no" title="statement not covered" > // Check if any bits below the round bit position in mantissa are set:</span>
556+
<span class="cstat-no" title="statement not covered" > stickyBits = ( mant &amp; ( ( 1 &lt;&lt; ( 13 - ( shift - 11 ) - 1 ) ) - 1 ) ) !== 0; // eslint-disable-line max-len</span>
578557
<span class="cstat-no" title="statement not covered" > }</span>
579558
&nbsp;
580559
// Apply the denormalization shift to the mantissa:
@@ -588,14 +567,14 @@ <h1><a href="index.html">All files</a> main.js</h1>
588567
return ( sign &lt;&lt; 15 ) | mantissa;
589568
}
590569
&nbsp;
591-
// Extract the top 10 bits of the mantissa for normal float16 representation:
592-
mantissa = mantissaHigh &gt;&gt;&gt; 10;
570+
// Extract the top 10 bits of the mantissa from 23 bits
571+
mantissa = mant &gt;&gt;&gt; 13;
593572
&nbsp;
594573
// Extract the round bit (the first bit that will be truncated):
595-
roundBit = ( mantissaHigh &gt;&gt;&gt; 9 ) &amp; 1;
574+
roundBit = ( mant &gt;&gt;&gt; 12 ) &amp; 1;
596575
&nbsp;
597-
// Check sticky bits (all bits below bit 41)
598-
stickyBits = ( ( mantissaHigh &amp; 0x1FF ) !== 0 ) || ( mantissaLow !== 0 );
576+
// Check sticky bits (all bits below bit 12)
577+
stickyBits = ( mant &amp; 0xFFF ) !== 0;
599578
&nbsp;
600579
// Round up if roundBit is 1 AND (sticky bits OR mantissa is odd)
601580
if ( roundBit &amp;&amp; ( stickyBits <span class="branch-0 cbranch-no" title="branch not covered" >|| ( mantissa &amp; 1 ) </span>) ) {
@@ -631,7 +610,7 @@ <h1><a href="index.html">All files</a> main.js</h1>
631610
<div class='footer quiet pad2 space-top1 center small'>
632611
Code coverage generated by
633612
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
634-
at 2025-11-27T10:10:54.218Z
613+
at 2025-12-02T09:11:57.970Z
635614
</div>
636615
<script src="prettify.js"></script>
637616
<script>

0 commit comments

Comments
 (0)