File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed
lib/node_modules/@stdlib/stats/base/dists/uniform/entropy Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -159,9 +159,9 @@ for ( i = 0; i < 10; i++ ) {
159159#include " stdlib/stats/base/dists/uniform/entropy.h"
160160```
161161
162- #### stdlib_base_dists_uniform_entropy( n, p )
162+ #### stdlib_base_dists_uniform_entropy( a, b )
163163
164- Evaluates the [ entropy] [ entropy ] of a [ Uniform ] [ uniform-distribution ] distribution with ` a ` the minimum support and ` b ` the maximum support.
164+ Evaluates the [ entropy] [ entropy ] of a [ uniform ] [ uniform-distribution ] distribution with ` a ` the minimum support and ` b ` the maximum support.
165165
166166``` c
167167double out = stdlib_base_dists_uniform_entropy( 4.0 , 12.0 );
Original file line number Diff line number Diff line change 2121#include <stdio.h>
2222
2323static 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 ) );
24+ double v = (double )rand () / ( (double )RAND_MAX + 1.0 );
25+ return min + ( v * (max - min ) );
2626}
2727
2828int main ( void ) {
Original file line number Diff line number Diff line change 1919#include "stdlib/stats/base/dists/uniform/entropy.h"
2020#include "stdlib/math/base/assert/is_nan.h"
2121#include "stdlib/math/base/special/ln.h"
22- #include <math.h>
2322
2423/**
2524* Returns the entropy of a uniform distribution.
2625*
2726* @param n minimum support
2827* @param p maximum support
29- * @returns entropy
28+ * @return entropy
3029*
3130* @example
3231* var v = entropy( 0.0, 1.0 );
4544* // returns NaN
4645*/
4746double stdlib_base_dists_uniform_entropy ( const double a , const double b ) {
48-
4947 if (
5048 stdlib_base_is_nan ( a ) ||
5149 stdlib_base_is_nan ( b ) ||
You can’t perform that action at this time.
0 commit comments