Skip to content

Commit b082d29

Browse files
committed
fix: update include paths and reorder includes
--- 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: na - 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: passed - task: lint_c_benchmarks status: passed - 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 3c8a4d5 commit b082d29

File tree

4 files changed

+14
-18
lines changed

4 files changed

+14
-18
lines changed

lib/node_modules/@stdlib/random/base/uniform/benchmark/c/benchmark.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
* limitations under the License.
1717
*/
1818

19+
#include "stdlib/random/base/uniform.h"
20+
#include "stdlib/random/base/randu.h"
21+
#include "stdlib/random/base/shared.h"
1922
#include <stdlib.h>
2023
#include <stdio.h>
2124
#include <stdint.h>
2225
#include <math.h>
2326
#include <time.h>
2427
#include <sys/time.h>
25-
#include "stdlib/random/base.h"
26-
#include "stdlib/random/base/randu.h"
27-
#include "stdlib/random/base/uniform.h"
2828

2929
#define NAME "base/uniform"
3030
#define ITERATIONS 1000000

lib/node_modules/@stdlib/random/base/uniform/examples/c/example.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
* limitations under the License.
1717
*/
1818

19+
#include "stdlib/random/base/uniform.h"
20+
#include "stdlib/random/base/randu.h"
21+
#include "stdlib/random/base/shared.h"
1922
#include <stdlib.h>
2023
#include <stdio.h>
21-
#include "stdlib/random/base.h"
22-
#include "stdlib/random/base/randu.h"
23-
#include "stdlib/random/base/uniform.h"
2424

2525
int main( void ) {
2626
int32_t i;

lib/node_modules/@stdlib/random/base/uniform/include/stdlib/random/base/uniform.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
#ifndef STDLIB_RANDOM_BASE_UNIFORM_H
2020
#define STDLIB_RANDOM_BASE_UNIFORM_H
2121

22-
// Note: keep project includes in alphabetical order...
23-
#include <stdarg.h>
24-
#include "stdlib/random/base.h"
22+
#include "stdlib/random/base/shared.h"
2523

2624
/*
2725
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.

lib/node_modules/@stdlib/random/base/uniform/src/main.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,28 @@
1616
* limitations under the License.
1717
*/
1818

19-
// Note: keep project includes in alphabetical order...
20-
#include <stdlib.h>
21-
#include <math.h>
22-
#include "stdlib/random/base.h"
2319
#include "stdlib/random/base/uniform.h"
20+
#include "stdlib/random/base/shared.h"
21+
#include <stdlib.h>
2422

2523
/**
2624
* Returns a pseudorandom number drawn from a continuous uniform distribution with parameters `a` (minimum support; inclusive) and `b` (maximum support; exclusive).
2725
*
2826
* ## Notes
2927
*
30-
* - The function returns `NAN` if provided a `NULL` pointer.
28+
* - The function returns `NaN` if provided a `NULL` pointer.
3129
*
3230
* @param randu PRNG object which generates uniformly distributed pseudorandom numbers on the interval `[0,1)`
3331
* @param a minimum support (inclusive)
3432
* @param b maximum support (exclusive)
3533
* @return pseudorandom number
3634
*
3735
* @example
36+
* #include "stdlib/random/base/uniform.h"
37+
* #include "stdlib/random/base/randu.h"
38+
* #include "stdlib/random/base/shared.h"
3839
* #include <stdlib.h>
3940
* #include <stdio.h>
40-
* #include "stdlib/random/base.h"
41-
* #include "stdlib/random/base/randu.h"
42-
* #include "stdlib/random/base/uniform.h"
4341
*
4442
* // Create a PRNG:
4543
* struct BasePRNGObject *randu = stdlib_base_random_randu_allocate( 0 );
@@ -65,7 +63,7 @@
6563
*/
6664
double stdlib_base_random_uniform( struct BasePRNGObject *randu, const double a, const double b ) {
6765
if ( randu == NULL ) {
68-
return NAN;
66+
return 0.0 / 0.0; // NaN
6967
}
7068
double r;
7169
randu->prng->normalized( randu, &r );

0 commit comments

Comments
 (0)