Skip to content

Commit

Permalink
v1.0.26
Browse files Browse the repository at this point in the history
- Fix:
  - `IterableNumExtension.standardDeviation`.
  - `IterableDoubleExtension.standardDeviation`.
  - `DecimalOnIterableDecimalExtension.standardDeviation`.
  - `DynamicIntOnIterableDynamicNumberExtension.standardDeviation`.

- sdk: '>=2.14.0 <4.0.0'
- intl: ^0.18.1
- dependency_validator: ^3.2.3
  • Loading branch information
gmpassos committed Sep 30, 2023
1 parent 3f5c369 commit 99f3aa0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## 1.0.26

- Fix `IterableNumExtension.standardDeviation`.
- Fix:
- `IterableNumExtension.standardDeviation`.
- `IterableDoubleExtension.standardDeviation`.
- `DecimalOnIterableDecimalExtension.standardDeviation`.
- `DynamicIntOnIterableDynamicNumberExtension.standardDeviation`.

- sdk: '>=2.14.0 <4.0.0'
- intl: ^0.18.1
Expand Down
2 changes: 1 addition & 1 deletion lib/src/statistics_decimal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@ extension DecimalOnIterableDecimalExtension on Iterable<Decimal> {

var average = mean;

var first = itr.current;
var first = itr.current - average;
var total = first * first;

while (itr.moveNext()) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/statistics_dynamic_int.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ extension DynamicIntOnIterableDynamicNumberExtension

var average = mean;

var first = itr.current;
var first = itr.current - average;
var total = first * first;

while (itr.moveNext()) {
Expand Down Expand Up @@ -1690,7 +1690,7 @@ extension DynamicIntOnIterableDynamicIntExtension on Iterable<DynamicInt> {

var average = mean;

var first = itr.current;
var first = itr.current - average;
var total = first * first;

while (itr.moveNext()) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/statistics_extension_num.dart
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ extension IterableDoubleExtension on Iterable<double> {

var average = mean;

var first = itr.current;
var first = itr.current - average;
var total = first * first;

while (itr.moveNext()) {
Expand Down Expand Up @@ -731,7 +731,7 @@ extension IterableIntExtension on Iterable<int> {

var average = mean;

var first = itr.current;
var first = itr.current - average;
var total = (first * first).toDouble();

while (itr.moveNext()) {
Expand Down
8 changes: 4 additions & 4 deletions test/statistics_extension_num_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ void main() {
test('standardDeviation', () {
expect(<int>[].standardDeviation, equals(0));
expect([0].standardDeviation, equals(0));
expect([10].standardDeviation, equals(10));
expect([10, 20].standardDeviation, equals(7.905694150420948));
expect([10].standardDeviation, equals(0));
expect([10, 20].standardDeviation, equals(5));
expect(<int>[10, 20, 30].standardDeviation, equals(8.16496580927726));
});

Expand Down Expand Up @@ -551,8 +551,8 @@ void main() {
test('standardDeviation', () {
expect(<double>[].standardDeviation, equals(0));
expect(<double>[0.0].standardDeviation, equals(0));
expect(<double>[10.0].standardDeviation, equals(10));
expect(<double>[10.0, 20.0].standardDeviation, equals(7.905694150420948));
expect(<double>[10.0].standardDeviation, equals(0));
expect(<double>[10.0, 20.0].standardDeviation, equals(5));
expect(<double>[10.0, 20.0, 30.0].standardDeviation,
equals(8.16496580927726));
});
Expand Down

0 comments on commit 99f3aa0

Please sign in to comment.