Skip to content

Commit f4abb76

Browse files
committed
Auto-generated commit
1 parent 40e53dc commit f4abb76

File tree

6 files changed

+87
-28
lines changed

6 files changed

+87
-28
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/dists/triangular/mgf) of the main repository where we’ll review and provide feedback.
44

5-
If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib.
5+
If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md) for help on developing stdlib.
66

77
We look forward to receiving your contribution! :smiley:

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-02-19)
7+
## Unreleased (2025-03-01)
88

99
<section class="features">
1010

@@ -34,6 +34,7 @@ This release closes the following issue:
3434

3535
<details>
3636

37+
- [`276f077`](https://github.com/stdlib-js/stdlib/commit/276f077fe99f7647d5f31256dc0220a45eedbf3e) - **test:** add tests to achieve 100% code coverage [(#5638)](https://github.com/stdlib-js/stdlib/pull/5638) _(by Karan Anand)_
3738
- [`c7bfa92`](https://github.com/stdlib-js/stdlib/commit/c7bfa923af0c5346766c90300e0d0a3c2188d438) - **docs:** fix missing ending `section` in various READMEs [(#5292)](https://github.com/stdlib-js/stdlib/pull/5292) _(by Saurabh Singh)_
3839
- [`1d5aa47`](https://github.com/stdlib-js/stdlib/commit/1d5aa47204c258b674d3db4aec92fbd2475e5ea7) - **chore:** directly draw from the desired distribution instead of adding constants _(by Philipp Burckhardt)_
3940
- [`c88e9f5`](https://github.com/stdlib-js/stdlib/commit/c88e9f51302adbe0d828fd298d9dbc138f6b3e7b) - **chore:** clean-up, fix tests, and add FIXMEs _(by Athan Reines)_
@@ -49,9 +50,10 @@ This release closes the following issue:
4950

5051
### Contributors
5152

52-
A total of 4 people contributed to this release. Thank you to the following contributors:
53+
A total of 5 people contributed to this release. Thank you to the following contributors:
5354

5455
- Athan Reines
56+
- Karan Anand
5557
- Philipp Burckhardt
5658
- Prashant Kumar Yadav
5759
- Saurabh Singh

CONTRIBUTORS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Aadish Jain <jain.aadishj@gmail.com>
66
Aayush Khanna <aayushiitbhu23@gmail.com>
77
Abhijit Raut <abhijitmraut8010@gmail.com>
8+
Abhishek Jain <40913033+abhishekblue@users.noreply.github.com>
89
Adarsh Palaskar <adarshpalaskar99@gmail.com>
910
Aditya Sapra <adityaework@gmail.com>
1011
Ahmed Atwa <Ahmedatwa866@yahoo.com>
@@ -54,9 +55,11 @@ Joey Reed <joeyrreed@gmail.com>
5455
Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com>
5556
Joris Labie <joris.labie1@gmail.com>
5657
Justin Dennison <justin1dennison@gmail.com>
58+
Justyn Shelby <96994781+ShelbyJustyn@users.noreply.github.com>
5759
Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
5860
Karthik Prakash <116057817+skoriop@users.noreply.github.com>
5961
Kohantika Nath <145763549+kohantikanath@users.noreply.github.com>
62+
Krishnam Agarwal <83017176+888krishnam@users.noreply.github.com>
6063
Krishnendu Das <86651039+itskdhere@users.noreply.github.com>
6164
Kshitij-Dale <152467202+Kshitij-Dale@users.noreply.github.com>
6265
Lovelin Dhoni J B <100030865+lovelindhoni@users.noreply.github.com>
@@ -94,6 +97,7 @@ Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
9497
Ricky Reusser <rsreusser@gmail.com>
9598
Ridam Garg <67867319+RidamGarg@users.noreply.github.com>
9699
Rishav <115060907+rishav2404@users.noreply.github.com>
100+
Rishav Tarway <rishavtarway@gmail.com>
97101
Robert Gislason <gztown2216@yahoo.com>
98102
Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com>
99103
Rutam Kathale <138517416+performant23@users.noreply.github.com>
@@ -132,7 +136,9 @@ Yaswanth Kosuru <116426380+yaswanthkosuru@users.noreply.github.com>
132136
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
133137
Yuvi Mittal <128018763+yuvi-mittal@users.noreply.github.com>
134138
ekambains <bainsinbusiness@gmail.com>
139+
fadiothman22 <48636283+fadiothman22@users.noreply.github.com>
135140
olenkabilonizhka <62379231+olenkabilonizhka@users.noreply.github.com>
136141
pranav-1720 <123018993+pranav-1720@users.noreply.github.com>
142+
rahulrangers <127782777+rahulrangers@users.noreply.github.com>
137143
rainn <88160429+AmCodesLame@users.noreply.github.com>
138144
rei2hu <reimu@reimu.ws>

test/test.factory.js

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,39 +56,39 @@ tape( 'if provided `NaN` for any parameter, the created function returns `NaN`',
5656

5757
mgf = factory( 0.0, 1.0, 0.5 );
5858
y = mgf( NaN );
59-
t.equal( isnan( y ), true, 'returns NaN' );
59+
t.equal( isnan( y ), true, 'returns expected value' );
6060

6161
mgf = factory( NaN, 1.0, 0.5 );
6262
y = mgf( 0.0 );
63-
t.equal( isnan( y ), true, 'returns NaN' );
63+
t.equal( isnan( y ), true, 'returns expected value' );
6464

6565
mgf = factory( 0.0, NaN, 0.5 );
6666
y = mgf( 0.0 );
67-
t.equal( isnan( y ), true, 'returns NaN' );
67+
t.equal( isnan( y ), true, 'returns expected value' );
6868

6969
mgf = factory( 0.0, 1.0, NaN );
7070
y = mgf( 0.0 );
71-
t.equal( isnan( y ), true, 'returns NaN' );
71+
t.equal( isnan( y ), true, 'returns expected value' );
7272

7373
mgf = factory( NaN, NaN, NaN );
7474
y = mgf( 0.0 );
75-
t.equal( isnan( y ), true, 'returns NaN' );
75+
t.equal( isnan( y ), true, 'returns expected value' );
7676

7777
mgf = factory( 0.0, NaN, NaN );
7878
y = mgf( 0.0 );
79-
t.equal( isnan( y ), true, 'returns NaN' );
79+
t.equal( isnan( y ), true, 'returns expected value' );
8080

8181
mgf = factory( NaN, 1.0, NaN );
8282
y = mgf( 0.0 );
83-
t.equal( isnan( y ), true, 'returns NaN' );
83+
t.equal( isnan( y ), true, 'returns expected value' );
8484

8585
mgf = factory( NaN, NaN, 0.5 );
8686
y = mgf( 0.0 );
87-
t.equal( isnan( y ), true, 'returns NaN' );
87+
t.equal( isnan( y ), true, 'returns expected value' );
8888

8989
mgf = factory( NaN, NaN, 0.5 );
9090
y = mgf( NaN );
91-
t.equal( isnan( y ), true, 'returns NaN' );
91+
t.equal( isnan( y ), true, 'returns expected value' );
9292

9393
t.end();
9494
});
@@ -100,34 +100,49 @@ tape( 'if provided parameters not satisfying `a <= c <= b`, the created function
100100
mgf = factory( 2.0, 1.0, 0.5 );
101101

102102
y = mgf( 2.0 );
103-
t.equal( isnan( y ), true, 'returns NaN' );
103+
t.equal( isnan( y ), true, 'returns expected value' );
104104

105105
y = mgf( 0.0 );
106-
t.equal( isnan( y ), true, 'returns NaN' );
106+
t.equal( isnan( y ), true, 'returns expected value' );
107107

108108
mgf = factory( 0.0, NINF, 0.5 );
109109
y = mgf( 2.0 );
110-
t.equal( isnan( y ), true, 'returns NaN' );
110+
t.equal( isnan( y ), true, 'returns expected value' );
111111

112112
mgf = factory( PINF, NINF, 0.5 );
113113
y = mgf( 2.0 );
114-
t.equal( isnan( y ), true, 'returns NaN' );
114+
t.equal( isnan( y ), true, 'returns expected value' );
115115

116116
mgf = factory( NINF, NINF, 0.5 );
117117
y = mgf( 2.0 );
118-
t.equal( isnan( y ), true, 'returns NaN' );
118+
t.equal( isnan( y ), true, 'returns expected value' );
119119

120120
mgf = factory( -1.0, -2.0, 0.5 );
121121
y = mgf( 2.0 );
122-
t.equal( isnan( y ), true, 'returns NaN' );
122+
t.equal( isnan( y ), true, 'returns expected value' );
123123

124124
mgf = factory( -10.0, 10.0, 12.0 );
125125
y = mgf( 2.0 );
126-
t.equal( isnan( y ), true, 'returns NaN' );
126+
t.equal( isnan( y ), true, 'returns expected value' );
127127

128128
mgf = factory( -10.0, 10.0, -12.0 );
129129
y = mgf( 2.0 );
130-
t.equal( isnan( y ), true, 'returns NaN' );
130+
t.equal( isnan( y ), true, 'returns expected value' );
131+
132+
t.end();
133+
});
134+
135+
tape( 'if provided valid `a`, `b`, and `c`, the function returns a function which returns `1` when provided `0` for `t`', function test( t ) {
136+
var mgf;
137+
var y;
138+
139+
mgf = factory( 0.0, 1.0, 0.5 );
140+
y = mgf( 0.0 );
141+
t.equal( y, 1.0, 'returns expected value' );
142+
143+
mgf = factory( -1.0, 1.0, 0.0 );
144+
y = mgf( 0.0 );
145+
t.equal( y, 1.0, 'returns expected value' );
131146

132147
t.end();
133148
});

test/test.mgf.js

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,48 @@ tape( 'main export is a function', function test( t ) {
4444

4545
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) {
4646
var y = mgf( NaN, 0.0, 1.0, 0.5 );
47-
t.equal( isnan( y ), true, 'returns NaN' );
47+
t.equal( isnan( y ), true, 'returns expected value' );
4848
y = mgf( 0.0, NaN, 1.0, 0.5 );
49-
t.equal( isnan( y ), true, 'returns NaN' );
49+
t.equal( isnan( y ), true, 'returns expected value' );
5050
y = mgf( 0.0, 1.0, NaN, 0.5 );
51-
t.equal( isnan( y ), true, 'returns NaN' );
51+
t.equal( isnan( y ), true, 'returns expected value' );
5252
y = mgf( 0.0, 0.0, 1.0, NaN );
53-
t.equal( isnan( y ), true, 'returns NaN' );
53+
t.equal( isnan( y ), true, 'returns expected value' );
5454
t.end();
5555
});
5656

5757
tape( 'if provided parameters not satisfying `a <= c <= b`, the function returns `NaN`', function test( t ) {
5858
var y;
5959

6060
y = mgf( 2.0, -1.0, -1.1, -1.0 );
61-
t.equal( isnan( y ), true, 'returns NaN' );
61+
t.equal( isnan( y ), true, 'returns expected value' );
6262

6363
y = mgf( 0.0, 3.0, 2.0, 2.5 );
64-
t.equal( isnan( y ), true, 'returns NaN' );
64+
t.equal( isnan( y ), true, 'returns expected value' );
6565

6666
y = mgf( 0.0, 0.0, 1.0, -1.0 );
67-
t.equal( isnan( y ), true, 'returns NaN' );
67+
t.equal( isnan( y ), true, 'returns expected value' );
6868

6969
y = mgf( 0.0, 0.0, 1.0, 2.0 );
70-
t.equal( isnan( y ), true, 'returns NaN' );
70+
t.equal( isnan( y ), true, 'returns expected value' );
71+
72+
t.end();
73+
});
74+
75+
tape( 'if provided `0` for `t` and valid `a`, `b` and `c`, the function returns `1`', function test( t ) {
76+
var y;
77+
78+
y = mgf( 0.0, -1.0, -1.0, -1.0 );
79+
t.equal( y, 1.0, 'returns expected value' );
80+
81+
y = mgf( 0.0, 0.0, 1.0, 0.5 );
82+
t.equal( y, 1.0, 'returns expected value' );
83+
84+
y = mgf( 0.0, 0.0, 1.0, 1.0 );
85+
t.equal( y, 1.0, 'returns expected value' );
86+
87+
y = mgf( 0.0, 1.0, 1.0, 1.0 );
88+
t.equal( y, 1.0, 'returns expected value' );
7189

7290
t.end();
7391
});

test/test.native.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,24 @@ tape( 'if provided parameters not satisfying `a <= c <= b`, the function returns
8181
t.end();
8282
});
8383

84+
tape( 'if provided `0` for `t` and valid `a`, `b` and `c`, the function returns `1`', function test( t ) {
85+
var y;
86+
87+
y = mgf( 0.0, -1.0, -1.0, -1.0 );
88+
t.equal( y, 1.0, 'returns expected value' );
89+
90+
y = mgf( 0.0, 0.0, 1.0, 0.5 );
91+
t.equal( y, 1.0, 'returns expected value' );
92+
93+
y = mgf( 0.0, 0.0, 1.0, 1.0 );
94+
t.equal( y, 1.0, 'returns expected value' );
95+
96+
y = mgf( 0.0, 1.0, 1.0, 1.0 );
97+
t.equal( y, 1.0, 'returns expected value' );
98+
99+
t.end();
100+
});
101+
84102
tape( 'the function evaluates the MGF for `x` given a small range `b - a`', opts, function test( t ) {
85103
var expected;
86104
var delta;

0 commit comments

Comments
 (0)