random_distribuitions 0.1.0

Dart native js
Flutter Android iOS web

This is a api to gerenate random numbers using gammavariate, expovariate and possion distribuitions.

random_distributions #

Pub Package

This is a Library for Dart to generate random numbers usings N distributions, like uniform, normal.

Import #

Use this command to impor the library in your program.

import 'package:random_distribuitions/src/random.dart';

Example #


library random_distribuitions;

import 'package:random_distribuitions/src/random.dart';

void main(){

  var testUniform = random();

  print(testUniform.uniform(1,2));

}

Uniform #

This is the first function that we have, we generate random numbers when a <= x <= b, 1/(b-a)


library random_distribuitions;

import 'package:random_distribuitions/src/random.dart';

void main(){

  var testUniform = random();// call the random class

  print(testUniform.uniform(1,2));// a = 1 and b = 2

}

Expovariate #

This is a distribution using exponential distribuition, -(log(uniform)/lambda)


library random_distribuitions;

import 'package:random_distribuitions/src/random.dart';

void main(){

  var rand = new random();//call the random class

  print(rand.expovariate(3));//3 is the lambda

}

0
likes
90
pub points
0%
popularity

Publisher

danielbandeira.dev

This is a api to gerenate random numbers using gammavariate, expovariate and possion distribuitions.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on random_distribuitions