Skip to content

Commit

Permalink
added bitwise xor, or and "and" (#28)
Browse files Browse the repository at this point in the history
* added bitwise xor, or and "and" #27 
* readme update #20
  • Loading branch information
krowinski authored Dec 11, 2018
1 parent ee1aecf commit 9d435fd
Show file tree
Hide file tree
Showing 3 changed files with 2,080 additions and 1,663 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Features
- getDecimalsLengthFromNumber - gets amount of decimals
- hexdec - converting from hexadecimal to decimal
- dechex - converting from decimal to hexadecimal
- bin2dec - converting from binary to decimal
- dec2bin - converting from decimal to binary
- new math functions
- round
- abs
Expand All @@ -34,12 +36,30 @@ Features
- roundDown
- roundUp
- ceil
- fmod (deprected just use mod)
- exp
- log
- fact
- pow (supports fractional)
- mod (supports fractional + scale in php 5.6 <)
- bitwise operators
- bitXor
- bitOr
- bitAnd
- proxy for original functions (http://php.net/manual/en/book.bc.php)
- all functions supports scientific notation
- all functions are static so it can be easy replaced by this lib

Info
===
As of 7.2 float can be passed to bcmod but they don't return correct values (IMO)

I created bug for this in https://bugs.php.net/bug.php?id=76287 but it was commented as documentation issue not a bug.

```
bcmod() doesn't use floor() but rather truncates towards zero,
which is also defined this way for POSIX fmod(), so that the
result always has the same sign as the dividend. Therefore, this
is not a bug, but rather a documentation issue.
```

But I still will use floor not truncated for mod in this lib.
Loading

0 comments on commit 9d435fd

Please sign in to comment.