Skip to content

Commit 3425c5a

Browse files
bench: add missing native.js and fix variable range
PR-URL: #6467 Reviewed-by: Athan Reines <[email protected]> Co-authored-by: stdlib-bot <[email protected]>
1 parent b3d21c0 commit 3425c5a

File tree

2 files changed

+76
-6
lines changed

2 files changed

+76
-6
lines changed

lib/node_modules/@stdlib/math/base/special/negalucas/benchmark/benchmark.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ bench( pkg, function benchmark( b ) {
4040
var y;
4141
var i;
4242

43-
x = discreteUniform( 100, -77, 0 );
43+
x = discreteUniform( 100, -76, 0 );
4444

4545
b.tic();
4646
for ( i = 0; i < b.iterations; i++ ) {
@@ -67,7 +67,7 @@ bench( pkg+'::analytic', function benchmark( b ) {
6767
return pow( -1.0, an ) * round( pow( PHI, an ) );
6868
}
6969

70-
x = discreteUniform( 100, -77, 0 );
70+
x = discreteUniform( 100, -76, 0 );
7171

7272
b.tic();
7373
for ( i = 0; i < b.iterations; i++ ) {
@@ -89,7 +89,7 @@ bench( pkg+'::table', function benchmark( b ) {
8989
var y;
9090
var i;
9191

92-
x = discreteUniform( 100, -77, 0 );
92+
x = discreteUniform( 100, -76, 0 );
9393

9494
b.tic();
9595
for ( i = 0; i < b.iterations; i++ ) {
@@ -197,7 +197,7 @@ bench( pkg+'::naive_iterative', function benchmark( b ) {
197197
return arr[ an ];
198198
}
199199

200-
x = discreteUniform( 100, -77, 0 );
200+
x = discreteUniform( 100, -76, 0 );
201201

202202
b.tic();
203203
for ( i = 0; i < b.iterations; i++ ) {
@@ -238,7 +238,7 @@ bench( pkg+'::iterative', function benchmark( b ) {
238238
return b;
239239
}
240240

241-
x = discreteUniform( 100, -77, 0 );
241+
x = discreteUniform( 100, -76, 0 );
242242

243243
b.tic();
244244
for ( i = 0; i < b.iterations; i++ ) {
@@ -281,7 +281,7 @@ bench( pkg+'::iterative_memoized', function benchmark( b ) {
281281
return arr[ an ];
282282
}
283283

284-
x = discreteUniform( 100, -77, 0 );
284+
x = discreteUniform( 100, -76, 0 );
285285

286286
b.tic();
287287
for ( i = 0; i < b.iterations; i++ ) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var addon = require( './../src/addon.node' );
24+
25+
26+
// MAIN //
27+
28+
/**
29+
* Computes the nth negaLucas number.
30+
*
31+
* @private
32+
* @param {NonPositiveInteger} n - the negaLucas number to compute
33+
* @returns {integer} negaLucas number
34+
*
35+
* @example
36+
* var y = negalucas( 0 );
37+
* // returns 2
38+
*
39+
* @example
40+
* y = negalucas( -1 );
41+
* // returns -1
42+
*
43+
* @example
44+
* y = negalucas( -2 );
45+
* // returns 3
46+
*
47+
* @example
48+
* y = negalucas( -3 );
49+
* // returns -4
50+
*
51+
* @example
52+
* y = negalucas( -4 );
53+
* // returns 7
54+
*
55+
* @example
56+
* y = negalucas( -5 );
57+
* // returns -11
58+
*
59+
* @example
60+
* y = negalucas( -6 );
61+
* // returns 18
62+
*/
63+
function negalucas( n ) {
64+
return addon( n );
65+
}
66+
67+
68+
// EXPORTS //
69+
70+
module.exports = negalucas;

0 commit comments

Comments
 (0)