Skip to content

Commit 0d53bc8

Browse files
committed
fix: correct imports to use max-nth-factorial constant
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 6647a76 commit 0d53bc8

File tree

14 files changed

+40
-40
lines changed

14 files changed

+40
-40
lines changed

lib/node_modules/@stdlib/math/base/special/factorial/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' );
2424
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
2525
var gamma = require( '@stdlib/math/base/special/gamma' );
2626
var PINF = require( '@stdlib/constants/float64/pinf' );
27-
var FLOAT64_MAX_SAFE_NTH_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-factorial' );
27+
var FLOAT64_MAX_NTH_FACTORIAL = require( '@stdlib/constants/float64/max-nth-factorial' );
2828
var FACTORIALS = require( './factorials.json' );
2929

3030

@@ -72,7 +72,7 @@ function factorial( x ) {
7272
if ( x < 0 ) {
7373
return NaN;
7474
}
75-
if ( x <= FLOAT64_MAX_SAFE_NTH_FACTORIAL ) {
75+
if ( x <= FLOAT64_MAX_NTH_FACTORIAL ) {
7676
return FACTORIALS[ x ];
7777
}
7878
return PINF;

lib/node_modules/@stdlib/math/base/special/factorial/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@stdlib/math/base/assert/is-integer",
4242
"@stdlib/math/base/special/gamma",
4343
"@stdlib/constants/float64/pinf",
44-
"@stdlib/constants/float64/max-safe-nth-factorial"
44+
"@stdlib/constants/float64/max-nth-factorial"
4545
]
4646
},
4747
{
@@ -59,7 +59,7 @@
5959
"@stdlib/math/base/assert/is-integer",
6060
"@stdlib/math/base/special/gamma",
6161
"@stdlib/constants/float64/pinf",
62-
"@stdlib/constants/float64/max-safe-nth-factorial"
62+
"@stdlib/constants/float64/max-nth-factorial"
6363
]
6464
},
6565
{
@@ -77,7 +77,7 @@
7777
"@stdlib/math/base/assert/is-integer",
7878
"@stdlib/math/base/special/gamma",
7979
"@stdlib/constants/float64/pinf",
80-
"@stdlib/constants/float64/max-safe-nth-factorial"
80+
"@stdlib/constants/float64/max-nth-factorial"
8181
]
8282
}
8383
]

lib/node_modules/@stdlib/math/base/special/factorial/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "stdlib/math/base/assert/is_integer.h"
2222
#include "stdlib/math/base/special/gamma.h"
2323
#include "stdlib/constants/float64/pinf.h"
24-
#include "stdlib/constants/float64/max_safe_nth_factorial.h"
24+
#include "stdlib/constants/float64/max_nth_factorial.h"
2525
#include <stdint.h>
2626

2727
static const double FACTORIALS[ 171 ] = {
@@ -217,7 +217,7 @@ double stdlib_base_factorial( const double x ) {
217217
if ( x < 0.0 ) {
218218
return 0.0 / 0.0; // NaN
219219
}
220-
if ( x <= STDLIB_CONSTANT_FLOAT64_MAX_SAFE_NTH_FACTORIAL ) {
220+
if ( x <= STDLIB_CONSTANT_FLOAT64_MAX_NTH_FACTORIAL ) {
221221
return FACTORIALS[ (int32_t)x ];
222222
}
223223
return STDLIB_CONSTANT_FLOAT64_PINF;

lib/node_modules/@stdlib/math/base/special/falling-factorial/lib/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var floor = require( '@stdlib/math/base/special/floor' );
4141
var abs = require( '@stdlib/math/base/special/abs' );
4242
var FLOAT64_MAX = require( '@stdlib/constants/float64/max' );
4343
var PINF = require( '@stdlib/constants/float64/pinf' );
44-
var FLOAT64_MAX_SAFE_NTH_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-factorial' ); // eslint-disable-line id-length
44+
var FLOAT64_MAX_NTH_FACTORIAL = require( '@stdlib/constants/float64/max-nth-factorial' );
4545

4646

4747
// FUNCTIONS //
@@ -177,10 +177,10 @@ function fallingFactorial( x, n ) {
177177
}
178178
if ( x < 0.5 ) {
179179
// Computing `1 + x` will throw away digits, so split up calculation...
180-
if ( n > FLOAT64_MAX_SAFE_NTH_FACTORIAL-2 ) {
180+
if ( n > FLOAT64_MAX_NTH_FACTORIAL-2 ) {
181181
// Given a ratio of two very large numbers, we need to split the calculation up into two blocks:
182-
t1 = x * fallingFactorial( x-1.0, FLOAT64_MAX_SAFE_NTH_FACTORIAL-2 ); // eslint-disable-line max-len
183-
t2 = fallingFactorial( x-FLOAT64_MAX_SAFE_NTH_FACTORIAL+1.0, n-FLOAT64_MAX_SAFE_NTH_FACTORIAL+1 ); // eslint-disable-line max-len
182+
t1 = x * fallingFactorial( x-1.0, FLOAT64_MAX_NTH_FACTORIAL-2 );
183+
t2 = fallingFactorial( x-FLOAT64_MAX_NTH_FACTORIAL+1.0, n-FLOAT64_MAX_NTH_FACTORIAL+1 ); // eslint-disable-line max-len
184184
if ( FLOAT64_MAX/abs(t1) < abs(t2) ) {
185185
return PINF;
186186
}

lib/node_modules/@stdlib/math/base/special/falling-factorial/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@stdlib/math/base/special/abs",
4646
"@stdlib/constants/float64/max",
4747
"@stdlib/constants/float64/pinf",
48-
"@stdlib/constants/float64/max-safe-nth-factorial"
48+
"@stdlib/constants/float64/max-nth-factorial"
4949
]
5050
},
5151
{
@@ -67,7 +67,7 @@
6767
"@stdlib/math/base/special/abs",
6868
"@stdlib/constants/float64/max",
6969
"@stdlib/constants/float64/pinf",
70-
"@stdlib/constants/float64/max-safe-nth-factorial"
70+
"@stdlib/constants/float64/max-nth-factorial"
7171
]
7272
},
7373
{
@@ -89,7 +89,7 @@
8989
"@stdlib/math/base/special/abs",
9090
"@stdlib/constants/float64/max",
9191
"@stdlib/constants/float64/pinf",
92-
"@stdlib/constants/float64/max-safe-nth-factorial"
92+
"@stdlib/constants/float64/max-nth-factorial"
9393
]
9494
}
9595
]

lib/node_modules/@stdlib/math/base/special/falling-factorial/src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include "stdlib/math/base/special/abs.h"
3939
#include "stdlib/constants/float64/max.h"
4040
#include "stdlib/constants/float64/pinf.h"
41-
#include "stdlib/constants/float64/max_safe_nth_factorial.h"
41+
#include "stdlib/constants/float64/max_nth_factorial.h"
4242
#include <stdint.h>
4343
#include <stdbool.h>
4444

@@ -160,10 +160,10 @@ double stdlib_base_falling_factorial( const double x, const int32_t n ) {
160160
}
161161
if ( x < 0.5 ) {
162162
// Computing `1 + x` will throw away digits, so split up calculation...
163-
if ( n > STDLIB_CONSTANT_FLOAT64_MAX_SAFE_NTH_FACTORIAL - 2 ) {
163+
if ( n > STDLIB_CONSTANT_FLOAT64_MAX_NTH_FACTORIAL - 2 ) {
164164
// Given a ratio of two very large numbers, we need to split the calculation up into two blocks:
165-
t1 = x * stdlib_base_falling_factorial( x - 1.0, STDLIB_CONSTANT_FLOAT64_MAX_SAFE_NTH_FACTORIAL - 2 );
166-
t2 = stdlib_base_falling_factorial( x - STDLIB_CONSTANT_FLOAT64_MAX_SAFE_NTH_FACTORIAL + 1.0, n - STDLIB_CONSTANT_FLOAT64_MAX_SAFE_NTH_FACTORIAL + 1 );
165+
t1 = x * stdlib_base_falling_factorial( x - 1.0, STDLIB_CONSTANT_FLOAT64_MAX_NTH_FACTORIAL - 2 );
166+
t2 = stdlib_base_falling_factorial( x - STDLIB_CONSTANT_FLOAT64_MAX_NTH_FACTORIAL + 1.0, n - STDLIB_CONSTANT_FLOAT64_MAX_NTH_FACTORIAL + 1 );
167167
if ( ( STDLIB_CONSTANT_FLOAT64_MAX / stdlib_base_abs( t1 ) ) < stdlib_base_abs( t2 ) ) {
168168
return STDLIB_CONSTANT_FLOAT64_PINF;
169169
}

lib/node_modules/@stdlib/math/base/special/gamma-delta-ratio/lib/gamma_delta_ratio_lanczos.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ var pow = require( '@stdlib/math/base/special/pow' );
4545
var EPSILON = require( '@stdlib/constants/float64/eps' );
4646
var E = require( '@stdlib/constants/float64/e' );
4747
var G = require( '@stdlib/constants/float64/gamma-lanczos-g' );
48-
var MAX_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-factorial' );
48+
var FLOAT64_MAX_NTH_FACTORIAL = require( '@stdlib/constants/float64/max-nth-factorial' );
4949

5050

5151
// VARIABLES //
@@ -80,8 +80,8 @@ function gammaDeltaRatioLanczos( z, delta ) {
8080
var zgh;
8181

8282
if ( z < EPSILON ) {
83-
if ( delta >= MAX_FACTORIAL ) {
84-
ratio = gammaDeltaRatioLanczos( delta, MAX_FACTORIAL-delta );
83+
if ( delta >= FLOAT64_MAX_NTH_FACTORIAL ) {
84+
ratio = gammaDeltaRatioLanczos( delta, FLOAT64_MAX_NTH_FACTORIAL-delta );
8585
ratio *= z;
8686
ratio *= FACTORIAL_169;
8787
return 1.0 / ratio;

lib/node_modules/@stdlib/math/base/special/gamma-delta-ratio/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var abs = require( '@stdlib/math/base/special/abs' );
4040
var floor = require( '@stdlib/math/base/special/floor' );
4141
var gamma = require( '@stdlib/math/base/special/gamma' );
4242
var factorial = require( '@stdlib/math/base/special/factorial' );
43-
var MAX_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-factorial' );
43+
var FLOAT64_MAX_NTH_FACTORIAL = require( '@stdlib/constants/float64/max-nth-factorial' );
4444
var gammaDeltaRatioLanczos = require( './gamma_delta_ratio_lanczos.js' );
4545

4646

@@ -87,7 +87,7 @@ function gammaDeltaRatio( z, delta ) {
8787
iz = floor( z );
8888
if ( iz === z ) {
8989
// As both `z` and `delta` are integers, see if we can use a table lookup:
90-
if ( z <= MAX_FACTORIAL && ( z + delta <= MAX_FACTORIAL ) ) {
90+
if ( z <= FLOAT64_MAX_NTH_FACTORIAL && ( z + delta <= FLOAT64_MAX_NTH_FACTORIAL ) ) {
9191
return factorial( iz - 1.0 ) / factorial( idelta + iz - 1.0 );
9292
}
9393
}

lib/node_modules/@stdlib/math/base/special/gamma-delta-ratio/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@stdlib/math/base/special/log1p",
4646
"@stdlib/math/base/special/exp",
4747
"@stdlib/math/base/special/pow",
48-
"@stdlib/constants/float64/max-safe-nth-factorial",
48+
"@stdlib/constants/float64/max-nth-factorial",
4949
"@stdlib/constants/float64/eps",
5050
"@stdlib/constants/float64/e",
5151
"@stdlib/constants/float64/gamma-lanczos-g"
@@ -70,7 +70,7 @@
7070
"@stdlib/math/base/special/log1p",
7171
"@stdlib/math/base/special/exp",
7272
"@stdlib/math/base/special/pow",
73-
"@stdlib/constants/float64/max-safe-nth-factorial",
73+
"@stdlib/constants/float64/max-nth-factorial",
7474
"@stdlib/constants/float64/eps",
7575
"@stdlib/constants/float64/e",
7676
"@stdlib/constants/float64/gamma-lanczos-g"
@@ -95,7 +95,7 @@
9595
"@stdlib/math/base/special/log1p",
9696
"@stdlib/math/base/special/exp",
9797
"@stdlib/math/base/special/pow",
98-
"@stdlib/constants/float64/max-safe-nth-factorial",
98+
"@stdlib/constants/float64/max-nth-factorial",
9999
"@stdlib/constants/float64/eps",
100100
"@stdlib/constants/float64/e",
101101
"@stdlib/constants/float64/gamma-lanczos-g"

lib/node_modules/@stdlib/math/base/special/gamma-delta-ratio/src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "stdlib/math/base/special/floor.h"
3838
#include "stdlib/math/base/special/gamma.h"
3939
#include "stdlib/math/base/special/factorial.h"
40-
#include "stdlib/constants/float64/max_safe_nth_factorial.h"
40+
#include "stdlib/constants/float64/max_nth_factorial.h"
4141
#include "stdlib/math/base/special/gamma_lanczos_sum.h"
4242
#include "stdlib/math/base/special/log1p.h"
4343
#include "stdlib/math/base/special/exp.h"
@@ -72,8 +72,8 @@ static double gammaDeltaRatioLanczos( const double z, const double delta ) {
7272
double zgh;
7373

7474
if ( z < STDLIB_CONSTANT_FLOAT64_EPS ) {
75-
if ( delta >= STDLIB_CONSTANT_FLOAT64_MAX_SAFE_NTH_FACTORIAL ) {
76-
ratio = gammaDeltaRatioLanczos( delta, STDLIB_CONSTANT_FLOAT64_MAX_SAFE_NTH_FACTORIAL - delta );
75+
if ( delta >= STDLIB_CONSTANT_FLOAT64_MAX_NTH_FACTORIAL ) {
76+
ratio = gammaDeltaRatioLanczos( delta, STDLIB_CONSTANT_FLOAT64_MAX_NTH_FACTORIAL - delta );
7777
ratio *= z;
7878
ratio *= FACTORIAL_169;
7979
return 1.0 / ratio;
@@ -135,7 +135,7 @@ double stdlib_base_gamma_delta_ratio( const double z, const double delta ) {
135135
iz = stdlib_base_floor( z );
136136
if ( iz == z ) {
137137
// As both `z` and `delta` are integers, see if we can use a table lookup:
138-
if ( z <= STDLIB_CONSTANT_FLOAT64_MAX_SAFE_NTH_FACTORIAL && ( z + delta <= STDLIB_CONSTANT_FLOAT64_MAX_SAFE_NTH_FACTORIAL ) ) {
138+
if ( z <= STDLIB_CONSTANT_FLOAT64_MAX_NTH_FACTORIAL && ( z + delta <= STDLIB_CONSTANT_FLOAT64_MAX_NTH_FACTORIAL ) ) {
139139
return stdlib_base_factorial( iz - 1.0 ) / stdlib_base_factorial( idelta + iz - 1.0 );
140140
}
141141
}

0 commit comments

Comments
 (0)