Algorithm-Kelly
view release on metacpan or search on metacpan
"runtime" : {
"requires" : {
"Exporter" : "0",
"base" : "0",
"strict" : "0",
"warnings" : "0"
}
},
"test" : {
"requires" : {
"Test::Fatal" : "0",
"Test::More" : "0"
}
}
},
"release_status" : "stable",
"resources" : {
"homepage" : "https://github.com/dnmfarrell/Algorithm-Kelly",
"repository" : {
"type" : "git",
"url" : "https://github.com/dnmfarrell/Algorithm-Kelly.git",
---
abstract: 'calculates the fraction of a bankroll to bet using the Kelly formula'
author:
- 'David Farrell <dfarrell@cpan.org>'
build_requires:
Test::Fatal: '0'
Test::More: '0'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 5.033, CPAN::Meta::Converter version 2.143240'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: Algorithm-Kelly
Makefile.PL view on Meta::CPAN
"EXE_FILES" => [],
"LICENSE" => "perl",
"NAME" => "Algorithm::Kelly",
"PREREQ_PM" => {
"Exporter" => 0,
"base" => 0,
"strict" => 0,
"warnings" => 0
},
"TEST_REQUIRES" => {
"Test::Fatal" => 0,
"Test::More" => 0
},
"VERSION" => "0.03",
"test" => {
"TESTS" => "t/*.t"
}
);
my %FallbackPrereqs = (
"Exporter" => 0,
"ExtUtils::MakeMaker" => 0,
"Test::Fatal" => 0,
"Test::More" => 0,
"base" => 0,
"strict" => 0,
"warnings" => 0
);
unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
delete $WriteMakefileArgs{TEST_REQUIRES};
delete $WriteMakefileArgs{BUILD_REQUIRES};
requires "Exporter" => "0";
requires "base" => "0";
requires "strict" => "0";
requires "warnings" => "0";
on 'test' => sub {
requires "Test::Fatal" => "0";
requires "Test::More" => "0";
};
on 'configure' => sub {
requires "ExtUtils::MakeMaker" => "0";
};
on 'develop' => sub {
requires "Pod::Coverage::TrustPod" => "0";
requires "Test::EOL" => "0";
use strict;
use warnings;
use Test::More;
use Test::Fatal;
BEGIN { use_ok 'Algorithm::Kelly' }
is optimal_f(0, 1), -1, 'Zero chance has optimal f of minus one';
is optimal_f(0.5, 2), 0.25, 'Fifty-fifty chance with net odds of two is a quarter of bankroll';
is optimal_f(1, 2), 1, 'One hundred percent chance has an optimal f of one';
ok exception { optimal_f(0) };
ok exception { optimal_f(-0.1, 50) };
ok exception { optimal_f(1.1, 4) };
( run in 1.455 second using v1.01-cache-2.11-cpan-54e63673c56 )