Skip to content

Commit b69ece4

Browse files
committed
feat:C implementation of stats/base/dists/weibull/skewness
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent d6b0185 commit b69ece4

File tree

1 file changed

+43
-0
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/weibull/skewness/examples/c

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
#include "stdlib/stats/base/dists/weibull/skewness.h"
20+
#include <stdlib.h>
21+
#include <stdio.h>
22+
23+
static double random_uniform( const double min, const double max ) {
24+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
25+
return min + ( v * (max - min) );
26+
}
27+
28+
int main( void ) {
29+
double k;
30+
double lambda;
31+
double y;
32+
int i;
33+
34+
for ( i = 0; i < 25; i++ ) {
35+
k = random_uniform( 1.0, 10.0 );
36+
37+
lambda = random_uniform( 1.0, 10.0 );
38+
39+
y = stdlib_base_dists_weibull_skewness( k, lambda );
40+
41+
printf( "k: %lf, lambda: %lf, Skewness: %lf\n", k, lambda, y );
42+
}
43+
}

0 commit comments

Comments
 (0)