NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #3476 most downloaded on pub.dev
Statistics package for easy and efficient data manipulation with built-in Bayesian Network (Bayes Net), many mathematical functions and tools.
Last release 1 months ago
26 Aug 2026
Ships fairly regularly
a new release about every 5 months
Nearly every release is documented
notes for 34 of 35 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
35 releases · first in 2014
Bug-fix release: fixes the two reported issues plus 7 more found while auditing the package.
Bug-fix release: fixes the two reported issues plus 7 more found while auditing the package.
Decimal division by a value lower than 1 (e.g. 5 / 0.5) threw an assert/ArgumentError for an invalid negative precision. (#14)standardDeviation returned NaN for a collection of equal double values. Statistics and StandardDeviationComputerNum now use Welford's online algorithm, which is numerically stable and returns exactly 0.0 for equal elements. It also fixes a loss of precision for collections of large values. (#12)Statistics.operator + merged standardDeviation from the BigInt sums, which are truncated for a non-integer collection, giving a wrong result. It now uses the parallel variance algorithm (Chan et al.).Decimal modulo (operator %, moduloInt, moduloBigInt, moduloDynamicInt) was not Euclidean for a fractional Decimal: -7 % 3 was 2 but -7.5 % 3 was -1.5.DynamicInt.digits counted the - sign for values with 10 or more digits. Since digits sets the precision of the division remainder refinement, (-a) / b and -(a / b) could differ.Statistics.compute, in the BigInt branch:
max > (maxSafeIntSqrt ~/ length), so a plain List<double> of large values was silently corrupted.min.abs(), so a collection of large negative values overflowed the int squares sum.sum/squaresSum were clamped to the maximum int when the BigInt value didn't fit.UnitLength: mi to mm/mic/nm used a mile of 1609 m instead of the exact 1609.344 m.normalizeCSVValue, generateCSV): a " inside a value was not escaped as "", and column names containing the separator were not quoted — both corrupt the document. Now follows RFC 4180.Added regression tests for every fix above, including cross-checks of the whole UnitLength conversion table, Decimal modulo/division matrices against num, and a CSV round trip through an RFC 4180 parser.
Full Changelog: v1.2.1...v1.2.2
One column per quarter.
Decimal:
Decimal lower than 1 (like 5 / 0.5), that was
throwing an assert/ArgumentError for an invalid negative precision.
See issue #14.Statistics and StandardDeviationComputerNum:
standardDeviation is now computed with Welford's online algorithm,
fixing the NaN result (a sqrt of a negative variance) for collections
of equal or nearly equal double values, and the loss of precision for
collections of large values. See issue #12.Statistics.operator +: standardDeviation is now merged with the
parallel variance algorithm (Chan et al.), fixing the wrong result for a
non-integer numeric collection (the BigInt sums are truncated).Decimal (modulo):
operator %, moduloInt, moduloBigInt and moduloDynamicInt now
return an Euclidean modulo (0 <= result < other.abs()) for a fractional
Decimal, as documented and as already done for a whole Decimal (that
delegates to DynamicInt.operator %). Before, -7 % 3 was 2 but
-7.5 % 3 was -1.5.DynamicInt:
digits counting the - sign as a digit for values with 10 or
more digits (the toString() fallback; the fast path already used
abs()). Since digits sets the precision of the division remainder
refinement, (-a) / b and -(a / b) could return different results.Statistics.compute:
BigInt computation no longer truncates a fractional collection.
It was selected automatically when max > (maxSafeIntSqrt ~/ length), so
a plain List<double> of large values was silently truncated
([100000000.5, 100000001.25, 100000002.75].statistics.sum returned
300000003 instead of 300000004.5).min.abs(): a collection of large
negative values overflowed the int squares sum, returning a negative
squaresSum/squaresMean.sum and squaresSum are no longer clamped to the maximum int when
the BigInt value doesn't fit in an int.UnitLength:
mi to mm/mic/nm conversions, that used a mile of 1609 m
instead of the exact 1609.344 m (all the other mile conversions already
used ~6 significant digits).CSV (normalizeCSVValue, generateCSV):
" inside a value is now escaped as "" and the value is quoted, as
required by RFC 4180. Before, both, "x" was written as "both, "x"",
which is read back as 2 corrupted fields.Tests: added regression tests for issues #12 and #14 and for every fix
above, including cross-checks of the whole UnitLength conversion table,
a Decimal modulo/division matrix against num, and a CSV round trip
through an RFC 4180 parser.
Added min , max and cast<N>() .
DynamicNumber:
min, max and cast<N>().New StatisticsBigInt and StatisticsDynamicNumber.
New IterableBigIntExtension.
Numeric extensions:
sum2 and mean2: returns a record with extra parameter allEqualsTo.mean and standardDeviation are computed in a way that minimizes floating-point precision errors.IterableExtension:
counts, countsSorted and mostFrequent.statistics_base_test.dart: improved numeric tests.
sdk: '>=3.6.0 <4.0.0' intl: ^0.20.2 collection: ^1.19.0 data_serializer: ^1.2.1 lints: ^5.1.1 test: ^1.25.15 dependency_validator: ^3.2.3 coverage: ^1
sdk: '>=3.6.0 <4.0.0'
intl: ^0.20.2
collection: ^1.19.0
data_serializer: ^1.2.1
lints: ^5.1.1
test: ^1.25.15
dependency_validator: ^3.2.3
coverage: ^1.11.1
_divideOperationByDynamicIntImpl2 : fix operation with therms of different signals ( -/+ or +/- ).
Decimal:
_divideOperationByDynamicIntImpl2: fix operation with therms of different signals (-/+ or +/-).sdk: '>=3.4.0 <4.0.0' data_serializer: ^1.2.0 coverage: ^1.9.0
sdk: '>=3.4.0 <4.0.0'
data_serializer: ^1.2.0
coverage: ^1.9.0
DynamicNumber : Added sin and cos . test: ^1.25.8 coverage: ^1.8.0
DynamicNumber:
sin and cos.test: ^1.25.8
coverage: ^1.8.0
sdk: '>=3.3.0 <4.0.0' intl: ^0.19.0 collection: ^1.18.0 data_serializer: ^1.1.0 lints: ^3.0.0 test: ^1.25.2 coverage: ^1.7.2
sdk: '>=3.3.0 <4.0.0'
intl: ^0.19.0
collection: ^1.18.0
data_serializer: ^1.1.0
lints: ^3.0.0
test: ^1.25.2
coverage: ^1.7.2
- Fix: - IterableNumExtension.standardDeviation. - IterableDoubleExtension.standardDeviation. - DecimalOnIterableDecimalExtension.standardDeviation. -
Merge v1.0.26 - fix stdv
- 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
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
Added withMaximumPrecision, withMinimumPrecision and clipPrecision.
Decimal:
withMaximumPrecision, withMinimumPrecision and clipPrecision.- intl: ^0.18.0 - lints: ^2.0.1 - test: ^1.22.1 - coverage: ^1.6.1
Merge v1.0.24
- intl: ^0.18.0
- lints: ^2.0.1
- test: ^1.22.1
- coverage: ^1.6.1
- DynamicNumber, DynamicInt, Decimal: - Added isWholeNumber, isOdd, isEven. - Added prime numbers support: - PrimeUtils, PrimeIntExtension, PrimeDynam
v1.0.23
- `DynamicNumber`, `DynamicInt`, `Decimal`:
- Added `isWholeNumber`, `isOdd`, `isEven`.
- Added prime numbers support:
- `PrimeUtils`, `PrimeIntExtension`, `PrimeDynamicNumberExtension`, `PrimeDecimalExtension`, `PrimeDynamicIntExtension`.
- Added extension NumericTypeExtension: - Methods: isNumericType, isNumericOrDynamicNumberType, isDynamicNumberType. - Added extension NumericTypeExte
v1.0.22
- Added extension `NumericTypeExtension`:
- Methods: `isNumericType`, `isNumericOrDynamicNumberType`, `isDynamicNumberType`.
- Added extension `NumericTypeExtension`:
- Methods: `isNumericValue`, `isNumericOrDynamicNumberValue`, `isDynamicNumberValue`, `whenNull`.
Added StandardDeviationComputer:
StandardDeviationComputer:
StandardDeviationComputerNumStandardDeviationComputerBigIntStandardDeviationComputerDynamicNumberAdded Decimal.tryParse and DynamicInt.tryParse.
Decimal.tryParse and DynamicInt.tryParse.Added High-Precision Arithmetic: DynamicInt and Decimal.
DynamicInt and Decimal.BayesianNetwork and BayesEventMonitor:
CountTable.BayesianNetwork and BayesEventMonitor:
Pair:
hashCode cache.generateCombinations:
validator.Chronometer:
totalOperation and method timeToComplete.toString:
withTime to withStartTime.Duration extension:
toStringUnit:
decimal.zero Duration.toStringDifferenceString extension
headEqualsLength, tailEqualsLength, headEquals, tailDifferent.ListExtension:
equalsElements, removeAll, retainAll, toDistinctList, shuffleCopy, randomSelection.SetExtension:
copy, equalsElements.IterableExtension:
copy, asList, asSet, whereIn, whereNotIn, equalsElements, computeHashcode.MapEntryExtension:
copy, equals, toPair.MapExtension:
copy.Now allows probability dependency between variables.
Pair.EventForecaster framework.BayesianNetwork:
addDependency.XOR.BayesEventMonitor:
CombinationCache and function generateCombinations.ListComparablesExtension changed to IterableComparablesExtension.
ListComparablesExtension changed to IterableComparablesExtension.IterableUint8ListExtension, ListAnswerExtension and ListOfListAnswer.ancestors, rootNodes, rootChain, rootChain.
Variable node optimization:
ancestors, rootNodes, rootChain, rootChain.VariableElimination:
Optimized parsing and building of network.
BayesianNetwork.
EventMonitor to help to build a BayesianNetwork and probabilities.- Added BayesianNetwork.
BayesianNetwork.Moved some extension methods to package data_serializer.
parseBigInt.data_serializer.StatisticsPlatform to package data_serializer as DataSerializerPlatform.data_serializer ^1.0.3Improved performance: toUint8List32Reversed and reverseBytes.
toUint8List32Reversed and reverseBytes.BigInt.thousands.Optimize Statistics to allow computation of big numbers without overflow issues.
Statistics to allow computation of big numbers without overflow issues.String: encodeLatin1, encodeUTF8, truncate`.
String: encodeLatin1, encodeUTF8, truncate`.Uint8List: copyAsUnmodifiable, asUnmodifiableView, toStringLatin1/bytes, toStringUTF8/bytes,
setUint8/16/32/64, setInt8/16/32/64.List<int>: toUint8List, asUint8List, compareWith.int: isSafeInteger, checkSafeInteger, int16/32/64ToBytes, uInt16/32/64ToBytes.BigInt: isSafeInteger, checkSafeInteger.UInt to Uint to follow Dart style.int: bits/8/16/32/64, toUint8List32Reversed, toUint8List64Reversed.
DateTime.elapsedTime.int: bits/8/16/32/64, toUint8List32Reversed, toUint8List64Reversed.Uint8List: bits/8/16/32/64.Chronometer.toString: added parameter withTime.
Chronometer.toString: added parameter withTime.StatisticsPlatform to ensure safe int serialization in any Dart platform.double extension: added toPercentage.int extension: added toBigInt, toUint8List32, toUint8List64, toHex32, toHex64, toStringPadded.BigInt and Uint8List.String.coverage.Chronometer.elapsedTimeMs: now returns the elapsed time even if not stopped.
Chronometer.elapsedTimeMs: now returns the elapsed time even if not stopped.Added medianHigh, medianLow and median.
Statistics:
medianHigh, medianLow and median.
medianHigh.center points to medianHigh.NumExtension:
num.cast.UnitLength and UnitLengthExtension.
UnitLength and UnitLengthExtension.parseDateTime.DateTimeExtension:
formatToYMD, formatToYMDHm, formatToYMDHms, formatToYMDHmZ and formatToYMDHmsZ.MapExtension:
equalsKeysValues.ListMapExtension:
sortByKey.IterableMapExtension:
sortedByKey.DoubleExtension:
truncateDecimals.splitColumns with acceptsQuotedValues.Changed from package pedantic (deprecated) to lints.
head, tail and sublistReversed.searchInsertSortedIndex and binarySearchPoint.resampleByIndex and resampleByValue.pedantic (deprecated) to lints.Added commaAsDecimalSeparator and decimalPrecision.
commaAsDecimalSeparator and decimalPrecision.DoubleEquality, IntEquality and NumEquality.
DoubleEquality, IntEquality and NumEquality.README.md.extension for int, double and num collections.
extension for int, double and num collections.Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →