Skip to content

Commit

Permalink
Correct errors in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Riimu committed Jan 31, 2015
1 parent 793762e commit 9298eec
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ number base, the method will return false instead.
While this library does support conversion of fractions, it's important to
understand that fractions cannot always be converted accurately from number base
to another the same way that integers can be converted. This is result of the
fact that not all fractions can be represented in another number system.
fact that not all fractions can be represented in another number base.

For example, let's say we have the number 0.1 in base 3. This equals the same
as 1/3 in base 10. However, if you were to represent 1/3 as a decimal number,
Expand All @@ -131,7 +131,7 @@ echo BaseConverter::baseConvert('0.1', 3, 10, 12); // outputs: 0.333333333333
```

Due to this behavior, it is possible to set the precision used for inaccurate
fractions conversions. As can be seen in the previous example, the precision
fraction conversions. As can be seen in the previous example, the precision
value defines the maximum number of digits in the resulting number. The result
may have less digits, however, if the number can be accurately converted using
a small number of digits. The precision may also be completely ignored, if the
Expand Down
8 changes: 4 additions & 4 deletions src/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public function setPrecision($precision);
* digits, except converted to the target number base.
*
* @param array $number Array of digits representing the integer part
* @return array Array of digits of the converted number
* @throws InvalidDigitException If the integer part contains invalid digits
* @return array Digits for the converted number
* @throws DigitList\InvalidDigitException If the integer part contains invalid digits
*/
public function convertInteger(array $number);

Expand All @@ -56,8 +56,8 @@ public function convertInteger(array $number);
* digits, except converted to the target number base.
*
* @param array $number Array of digits representing the fractional part
* @return array Array of digits of the converted number
* @throws InvalidDigitException If the fractional part contain invalid digits.
* @return array Digits for the converted number
* @throws DigitList\InvalidDigitException If the fractional part contain invalid digits.
*/
public function convertFractions(array $number);
}
1 change: 1 addition & 0 deletions src/DigitList/AbstractDigitList.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

namespace Riimu\Kit\BaseConversion\DigitList;

/**
* Provides common functionality for different digit lists.
* @author Riikka Kalliomäki <riikka.kalliomaki@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/DigitList/DigitList.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function getDigit($value);
* Returns the value for the given digit.
* @param mixed $digit Digit to search for
* @return integer The value of the digit
* @throws Riimu\Kit\BaseConversion\InvalidDigitException if the digit is invalid
* @throws InvalidDigitException if the digit is invalid
*/
public function getValue($digit);

Expand Down
8 changes: 4 additions & 4 deletions src/NumberBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class NumberBase
*
* The constructor takes a list of digits for the numeral system as the
* constructor parameter. This can either be an instance of DigitList or
* it can be a string, an integer or an array that is used to construct a
* it can be a string, an integer or an array that is used to construct
* the appropriate type of DigitList. See the constructors for appropriate
* classes for how to define those digit lists.
*
Expand Down Expand Up @@ -113,7 +113,7 @@ public function hasDigit($digit)
* Returns the decimal value represented by the given digit.
* @param mixed $digit The digit to look up
* @return integer The decimal value for the provided digit
* @throws InvalidDigitException If the given digit is invalid
* @throws DigitList\InvalidDigitException If the given digit is invalid
*/
public function getValue($digit)
{
Expand All @@ -124,7 +124,7 @@ public function getValue($digit)
* Returns the decimal values for given digits.
* @param array $digits Array of digits to look up
* @return integer[] Array of digit values
* @throws InvalidDigitException If any of the digits is invalid
* @throws DigitList\InvalidDigitException If any of the digits is invalid
*/
public function getValues(array $digits)
{
Expand Down Expand Up @@ -203,7 +203,7 @@ private function getRadixRoots()
*
* @param array $digits List of digits to canonize
* @return array Canonized list of digits
* @throws InvalidDigitException If any of the digits are invalid
* @throws DigitList\InvalidDigitException If any of the digits are invalid
*/
public function canonizeDigits(array $digits)
{
Expand Down

0 comments on commit 9298eec

Please sign in to comment.