1
0
mirror of https://github.com/danog/math.git synced 2024-11-27 12:24:45 +01:00
Commit Graph

63 Commits

Author SHA1 Message Date
Benjamin Morel
095ae53a9b BigRational now implements Serializable
This allows for a more compact serialized representation.
2015-06-12 23:35:34 +02:00
Benjamin Morel
b1239d9f44 Add tests for lines not covered 2015-06-12 23:07:22 +02:00
Benjamin Morel
38e7c83089 Add a BigRational class to deal with fractions 2015-06-12 15:49:35 +02:00
Benjamin Morel
1ff8b8b2d3 More notes about serializing 2015-06-12 12:59:24 +02:00
Benjamin Morel
5533b2aa36 Move rounding code from Calculator to BigDecimal 2015-06-12 10:25:09 +00:00
Benjamin Morel
cc30889769 BigInteger::dividedBy() now always returns the quotient
Rounding is a concept left to BigDecimal only from now on.
2015-06-12 10:25:00 +00:00
Benjamin Morel
115455238b Clean up unused imports 2015-06-12 01:20:44 +02:00
Benjamin Morel
0dcae82742 Remove useless of() call in tests 2015-06-12 01:17:42 +02:00
Benjamin Morel
4f4b9531ed Add BigInteger::gcd()
This computes the greatest common divisor of two large integers.
2015-06-11 23:35:47 +02:00
Benjamin Morel
1f577afe11 Add BigInteger::remainder() method
This allows to return the remainder of the division only.
2015-06-11 22:31:07 +02:00
Benjamin Morel
2c35d6fc5b Fix negative numbers not supported by toString() 2015-06-08 00:12:50 +02:00
Benjamin Morel
de917b9e17 Add license badge 2015-06-07 15:18:07 +02:00
Benjamin Morel
427faf03dc Reverted comment on HHVM
This component does not make use of typed variadics, so HHVM is already supported.
2015-06-07 15:06:25 +02:00
Benjamin Morel
e9da17c78d Add getSign() method to BigInteger and BigDecimal 2015-06-07 14:48:49 +02:00
Benjamin Morel
2aabbe1a53 Missing division by zero test for BigDecimal::divideAndRemainder() 2015-06-05 22:19:20 +02:00
Benjamin Morel
536e6414e6 Performance optimizations 2015-06-05 22:17:20 +02:00
Benjamin Morel
e650137344 Replace call to max() function
This provides a slight performance improvement on PHP 5.
2015-06-05 10:35:36 +02:00
Benjamin Morel
b0a784c402 Add note about facebook/hhvm#4858 bug 2015-06-05 10:31:04 +02:00
Benjamin Morel
a93fc20205 Fix BigDecimal::dividedBy() example 2015-06-05 10:19:23 +02:00
Benjamin Morel
c642d0d0c9 Change Money::dividedBy() parameter order 2015-06-04 21:45:13 +02:00
Benjamin Morel
4f3095cca1 CS fixes
BigDecimal and BigInteger were mentioned using FQCN in some places, and short names in others; only short names are used now for consistency.
2015-06-04 12:18:26 +02:00
Benjamin Morel
908e73e8e4 unserialize() now throws an exception when called directly
This guarantees that immutability cannot be broken.
2015-06-04 12:14:42 +02:00
Benjamin Morel
53a61b46a7 Add BigDecimal::divideAndRemainder() 2015-06-02 22:08:56 +02:00
Benjamin Morel
4d7f27fb8b Doc fix: negated and inverse are not the same thing 2015-06-02 21:10:58 +02:00
Benjamin Morel
4fbfdf4e74 Update license year 2015-05-31 18:49:21 +02:00
Benjamin Morel
d9b34f43d2 Remove useless director in Travis build 2015-05-31 18:46:28 +02:00
Benjamin Morel
49ea5a085e Reworked Travis build matrix
Travis now supports merged code coverage reports, so we do not need to merge them ourselves.
2015-05-22 13:39:59 +02:00
Benjamin Morel
9ab6358fc2 min() and max() now use variadics 2015-05-22 13:19:08 +02:00
Benjamin Morel
d246c7b02d Next version will require PHP 5.6 2015-05-22 13:12:06 +02:00
Benjamin Morel
1bd87f94ab Travis no longer supports hhvm-nightly
See travis-ci/travis-ci#3788
2015-05-14 14:41:29 +02:00
Benjamin Morel
f8eb20049a Added a reference script to run all tests
This script is also used by Travis.
2015-01-27 20:41:14 +01:00
Benjamin Morel
62fec07bfa Reorganized tests around two PHPUnit config files 2015-01-27 20:16:53 +01:00
Benjamin Morel
1197dd2b81 Calculator detect test is now run separately
This avoids the risk of this test being run before the main tests, and overriding the calculator set by the bootstrap script.
2015-01-27 18:44:21 +01:00
Benjamin Morel
80b85d3859 Added precision about serialization 2015-01-27 18:00:31 +01:00
Benjamin Morel
cdd6257fd0 Present rounding modes as a table 2015-01-27 17:57:57 +01:00
Benjamin Morel
4d18be75e1 Tests now run a single calculator instance at a time 2015-01-27 17:38:31 +01:00
Benjamin Morel
bdddaeaa8d Added uncovered files to code coverage 2015-01-27 14:53:17 +01:00
Benjamin Morel
d6f82760c6 Added whitelist for code coverage 2015-01-21 20:57:48 +01:00
Benjamin Morel
fb6f790702 Changed badges to SVG 2015-01-21 20:02:37 +01:00
Benjamin Morel
8bf792b5d2 Fixed typo 2014-11-21 11:37:53 +01:00
Benjamin Morel
bd5124d07e Added hhvm-nightly to Travis 2014-09-16 15:00:13 +02:00
Benjamin Morel
37ae7ecd55 Added master branch to Travis and Coveralls badges 2014-09-14 00:07:49 +02:00
Benjamin Morel
04ad891fe0 Added .idea to .gitignore 2014-09-12 11:06:02 +02:00
Benjamin Morel
b80985f588 Added division example for BigDecimal 2014-09-01 22:51:47 +02:00
Benjamin Morel
61968fcee9 Added BigInteger::power() 2014-09-01 19:10:04 +02:00
Benjamin Morel
d2a9a1300c Added official HHVM support
HHVM is not an allowed failure anymore in Travis.
2014-09-01 18:55:10 +02:00
Benjamin Morel
09a4aa2895 Imposed a limit on the power() exponent
Just discovered that bcpow() on HHVM has a weird exponent limit of 2^27+1 (empirically determined), after which it triggers an "exponent too large in raise" error.
Anyway, an exponent of 1,000,000 is more than reasonable for most, if not all, use cases.
2014-09-01 18:38:00 +02:00
Benjamin Morel
d4a2a45f25 Fixed tests for HHVM with BCMath 2014-09-01 17:38:18 +02:00
Benjamin Morel
e69a567957 Removed unnecessary serialization example from README 2014-09-01 11:37:00 +02:00
Benjamin Morel
ae9701968e Updated .travis.yml
- Use the phpunit version installed via composer
- Do not prefix coveralls with PHP, it's a shell script
2014-08-31 20:51:41 +02:00