Overview

Pub Package Github Actions CI PRs Welcome

Mathematical and statistical functions and classes for Dart and Flutter developers. Tensors / vectors / matrices, probability distributions, and more.

Licensed under the Apache License 2.0. Want to improve the package? Please send a pull request in Github.

Getting started

1.Add dependency

In pubspec.yaml:

dependencies:
  calc: ^0.2.0+1

2.Use it

Read documentation of APIs.

A simple example:

import 'package:calc/calc.dart';

void main() {
  final numbers = [1,2,3,4];
  final mean = numbers.mean();
  final variance = numbers.variance();
  print('mean: $mean, variance: $variance');
}

Content

dart:math

The package re-exports everything in dart:math (basic mathematical functions/constants like log and pi) for convenience of developers. We don't expect dart:math to have drastic changes that would break semantic versioning of this package.

Tensors, vectors, and matrices

Probability and statistics

Classes:

Functions:

Extensions for Iterable

The following extension classes add methods such as max(), mean() and variance():

Libraries

calc
Mathematical and statistical functions and classes.