Browse Source

Merge branch 'kojix2-patch-1'

pull/3/head
Arthur POULET 4 years ago
parent
commit
4b7435ad9a
No known key found for this signature in database GPG Key ID: FC154EA63FF5D8BC
  1. 4
      README.md
  2. 6
      spec/binomial_distribution.cr
  3. 4
      spec/normale_distribution.cr
  4. 4
      src/lib/math/big_number.cr
  5. 2
      src/lib/math/coef_binomial.cr
  6. 3
      src/stats.cr

4
README.md

@ -1,7 +1,7 @@
# stats
An expressive implementation of statistical distributions.
Compatible with crystal v0.23
Compatible with crystal v0.24.1
## Installation
@ -9,7 +9,7 @@ Add this to your application's `shard.yml`:
```yaml
dependencies:
Stats:
stats:
github: Nephos/stats
```

6
spec/binomial_distribution.cr

@ -21,9 +21,9 @@ describe BinomialDistribution do
end
it "initialize errors" do
expect_raises { BinomialDistribution(Int32, Float64).new(-1) }
expect_raises { BinomialDistribution.new(0, -1) }
expect_raises { BinomialDistribution.new(0, 1.5) }
expect_raises(Math::DomainError) { BinomialDistribution(Int32, Float64).new(-1) }
expect_raises(Math::DomainError) { BinomialDistribution.new(0, -1) }
expect_raises(Math::DomainError) { BinomialDistribution.new(0, 1.5) }
end
it "distribute" do

4
spec/normale_distribution.cr

@ -41,7 +41,7 @@ describe NormaleDistribution::Persistant do
end
it "must fail" do
expect_raises { NormaleDistribution::Persistant(Int32, Float64).new standard_deviation: -1 }
expect_raises { NormaleDistribution::Persistant(Int32, Float64).new standard_deviation: 0 }
expect_raises(ArgumentError) { NormaleDistribution::Persistant(Int32, Float64).new standard_deviation: -1 }
expect_raises(ArgumentError) { NormaleDistribution::Persistant(Int32, Float64).new standard_deviation: 0 }
end
end

4
src/lib/math/big_number.cr

@ -1,9 +1,7 @@
# This file defines new operations on big numbers with native data types
# :nodoc:
require "big_int"
# :nodoc:
require "big_float"
require "big"
{% for klass in [Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64] %}
# :nodoc:

2
src/lib/math/coef_binomial.cr

@ -1,5 +1,5 @@
# :nodoc:
require "big_int"
require "big"
require "./factorial"

3
src/stats.cr

@ -1,5 +1,4 @@
# require "big_int"
# require "big_float"
# require "big"
require "./stats/*"
require "./lib/*"

Loading…
Cancel
Save