File tree Expand file tree Collapse file tree 3 files changed +2080
-1663
lines changed
Expand file tree Collapse file tree 3 files changed +2080
-1663
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ Features
2525 - getDecimalsLengthFromNumber - gets amount of decimals
2626 - hexdec - converting from hexadecimal to decimal
2727 - dechex - converting from decimal to hexadecimal
28+ - bin2dec - converting from binary to decimal
29+ - dec2bin - converting from decimal to binary
2830- new math functions
2931 - round
3032 - abs
@@ -34,12 +36,30 @@ Features
3436 - roundDown
3537 - roundUp
3638 - ceil
37- - fmod (deprected just use mod)
3839 - exp
3940 - log
4041 - fact
4142 - pow (supports fractional)
4243 - mod (supports fractional + scale in php 5.6 <)
44+ - bitwise operators
45+ - bitXor
46+ - bitOr
47+ - bitAnd
4348- proxy for original functions (http://php.net/manual/en/book.bc.php )
4449- all functions supports scientific notation
4550- all functions are static so it can be easy replaced by this lib
51+
52+ Info
53+ ===
54+ As of 7.2 float can be passed to bcmod but they don't return correct values (IMO)
55+
56+ I created bug for this in https://bugs.php.net/bug.php?id=76287 but it was commented as documentation issue not a bug.
57+
58+ ```
59+ bcmod() doesn't use floor() but rather truncates towards zero,
60+ which is also defined this way for POSIX fmod(), so that the
61+ result always has the same sign as the dividend. Therefore, this
62+ is not a bug, but rather a documentation issue.
63+ ```
64+
65+ But I still will use floor not truncated for mod in this lib.
You can’t perform that action at this time.
0 commit comments