2017 © Pedro Peláez
 

library phi

An analogue fractional calculator

image

delboy1978uk/phi

An analogue fractional calculator

  • Friday, November 3, 2017
  • by delboy1978uk
  • Repository
  • 1 Watchers
  • 1 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

phi

Build Status Code Coverage Scrutinizer Code Quality
Floats suck. So lets make an analogue fractional calculator. Join in!, (*1)

v0.0.5

Refactoring fractions (apparently) works! We might need more test cases. Help us add some!, (*2)

install the project

First fork the project on GitHub. Then,, (*3)

git clone https://github.com/your-github-name/phi
cd phi
composer install

run the tests

codecept run unit --coverage-html

Or you can log into https://travis-ci.org/ and hook up your forked repository. Then by git pushing the tests will run., (*4)

do your thing

You either build, break, or fix. Get the test passing, or add a new set of data which will make the tests fail., (*5)

new feature

We have a setNegative($bool) method for negative fractions. We haven't added any test cases for that, so why not join in the fun? :-), (*6)

adding a test case

In tests/unit/Phi/PhiTest.php you can see the testToString() test. There is a dataset, each being an array with four values; the whole, the numerator, the denominator, and the expected string output. Contributing can be as simple as throwing some numbers in there and try to break the class!, (*7)

send your pull request

Because contributing to open source is fun!, (*8)

usage

Right now, there is only one class, Del\Phi\Fraction. An object representing a fraction, comprising of a whole number, and fractional numerator and denominator., (*9)

<?php 

use Del\Phi\Fraction;

$phi = new Fraction();
$phi->setWhole(3)
    ->setNumerator(3)
    ->setDenominator(4);

echo $phi->toDecimal(); // float 3.75
echo $phi;              // string '3 3/4'

More functionality will be made soon, but first we need tests which will break the current logic and give us unexpected output! (for example '3 3/3' should really output 4), (*10)

The Versions

03/11 2017

dev-master

9999999-dev

An analogue fractional calculator

  Sources   Download

MIT

The Development Requires

by Derek McLean

03/11 2017

v0.1.0

0.1.0.0

An analogue fractional calculator

  Sources   Download

MIT

The Development Requires

by Derek McLean

25/10 2017

v0.0.5

0.0.5.0

An analogue fractional calculator

  Sources   Download

MIT

The Development Requires

by Derek McLean

24/10 2017

v0.0.4

0.0.4.0

An analogue fractional calculator

  Sources   Download

MIT

The Development Requires

by Derek McLean

21/10 2017

v0.0.3

0.0.3.0

An analogue fractional calculator

  Sources   Download

MIT

The Development Requires

by Derek McLean

20/10 2017

v0.0.2

0.0.2.0

An analogue fractional calculator

  Sources   Download

MIT

The Development Requires

by Derek McLean

20/10 2017

v0.0.1

0.0.1.0

An analogue fractional calculator

  Sources   Download

MIT

The Development Requires

by Derek McLean