Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crates.io badge, use HTTPS for links, and use SPDX license format #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ homepage = "https://github.com/BurntSushi/rust-stats"
repository = "https://github.com/BurntSushi/rust-stats"
readme = "README.md"
keywords = ["statistics", "stats", "median", "mean", "stddev"]
license = "Unlicense/MIT"
license = "Unlicense OR MIT"

[lib]
name = "stats"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ some support for computing them efficiently on *streams* of data. The intent
is to permit parallel computation of statistics on large data sets.

[![Build status](https://api.travis-ci.org/BurntSushi/rust-stats.png)](https://travis-ci.org/BurntSushi/rust-stats)
[![](http://meritbadge.herokuapp.com/streaming-stats)](https://crates.io/crates/streaming-stats)
[![crates.io](https://img.shields.io/crates/v/streaming-stats.svg)](https://crates.io/crates/streaming-stats)

Dual-licensed under MIT or the [UNLICENSE](http://unlicense.org).
Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/).


### Documentation
Expand Down
6 changes: 3 additions & 3 deletions src/online.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ impl OnlineStats {
/// Add a new sample.
pub fn add<T: ToPrimitive>(&mut self, sample: T) {
let sample = sample.to_f64().unwrap();
// Taken from: http://goo.gl/JKeqvj
// See also: http://goo.gl/qTtI3V
// Taken from: https://goo.gl/JKeqvj
// See also: https://goo.gl/qTtI3V
let oldmean = self.mean;
let prevq = self.variance * (self.size as f64);

Expand All @@ -89,7 +89,7 @@ impl OnlineStats {

impl Commute for OnlineStats {
fn merge(&mut self, v: OnlineStats) {
// Taken from: http://goo.gl/iODi28
// Taken from: https://goo.gl/iODi28
let (s1, s2) = (self.size as f64, v.size as f64);
let meandiffsq = (self.mean - v.mean) * (self.mean - v.mean);
let mean = ((s1 * self.mean) + (s2 * v.mean)) / (s1 + s2);
Expand Down