2017 © Pedro Peláez
 

library bcmath-extended

Extends php BCMath lib for missing functions like floor, ceil, round, abs, min, max, rand for big numbers. Also wraps existing BCMath functions. (more http://php.net/manual/en/book.bc.php) Supports scientific notation.s

image

krowinski/bcmath-extended

Extends php BCMath lib for missing functions like floor, ceil, round, abs, min, max, rand for big numbers. Also wraps existing BCMath functions. (more http://php.net/manual/en/book.bc.php) Supports scientific notation.s

  • Thursday, May 17, 2018
  • by krowinski
  • Repository
  • 4 Watchers
  • 20 Stars
  • 7,171 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 17 Versions
  • 51 % Grown

The README.md

bcmath-extended

PHP Tests Code Coverage Latest Stable Version Total Downloads License, (*1)

Extends php BCMath lib for missing functions like floor, ceil, round, abs, min, max, rand for big numbers. Also wraps existing BCMath functions. (more http://php.net/manual/en/book.bc.php), (*2)

Installation

composer require krowinski/bcmath-extended

Features

  • config
    • setTrimTrailingZeroes - disable|enable trailing zeros (default trimming is enabled)
  • new tool methods
    • convertScientificNotationToString - converts scientific notation to string
    • getScale - gets current global scale
    • 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
    • rand
    • max
    • min
    • roundDown
    • roundUp
    • roundHalfEven
    • ceil
    • 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 easily replaced by this lib

Info

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

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

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., (*5)

The Versions

17/05 2018

dev-master

9999999-dev

Extends php BCMath lib for missing functions like floor, ceil, round, abs, min, max, rand for big numbers. Also wraps existing BCMath functions. (more http://php.net/manual/en/book.bc.php) Supports scientific notation.s

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by KR
by Kacper Rowinski

php math precision bcmath arbitrary-precision round bignumber floor bc ceil rand abs complex-numbers scientific-notation

17/05 2018

3.0.0

3.0.0.0

Extends php BCMath lib for missing functions like floor, ceil, round, abs, min, max, rand for big numbers. Also wraps existing BCMath functions. (more http://php.net/manual/en/book.bc.php) Supports scientific notation.s

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by Kacper Rowinski

php math precision bcmath arbitrary-precision round bignumber floor bc ceil rand abs complex-numbers scientific-notation

30/04 2018

2.0.1

2.0.1.0

Extends php BCMath lib for missing functions like floor, ceil, round, abs, min, max, rand for big numbers. Also wraps existing BCMath functions. (more http://php.net/manual/en/book.bc.php) Supports scientific notation.s

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by Kacper Rowinski

php math precision bcmath arbitrary-precision round bignumber floor bc ceil rand abs complex-numbers scientific-notation

30/04 2018

dev-feautre/issiue-18

dev-feautre/issiue-18

Extends php BCMath lib for missing functions like floor, ceil, round, abs, min, max, rand for big numbers. Also wraps existing BCMath functions. (more http://php.net/manual/en/book.bc.php) Supports scientific notation.s

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by Kacper Rowinski

php math precision bcmath arbitrary-precision round bignumber floor bc ceil rand abs complex-numbers scientific-notation

17/11 2017

2.0.0

2.0.0.0

Extends php BCMath lib for missing functions like floor, ceil, round, abs, min, max, rand for big numbers. Also wraps existing BCMath functions. (more http://php.net/manual/en/book.bc.php) Supports scientific notation.s

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by Kacper Rowinski

php math precision bcmath arbitrary-precision round bignumber floor bc ceil rand abs complex-numbers scientific-notation

17/11 2017

2.0.0-rc.2

2.0.0.0-RC2

Extends php BCMath lib for missing functions like floor, ceil, round, abs, min, max, rand for big numbers. Also wraps existing BCMath functions. (more http://php.net/manual/en/book.bc.php) Supports scientific notation.s

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by Kacper Rowinski

php math precision bcmath arbitrary-precision round bignumber floor bc ceil rand abs complex-numbers scientific-notation

12/11 2017

2.0.0-rc.1

2.0.0.0-RC1

Extends php BCMath lib for missing functions like floor, ceil, round

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by Kacper Rowinski

php math precision bcmath arbitrary-precision round bignumber floor bc ceil rand abs complex-numbers

18/10 2017

v1.3.6

1.3.6.0

Extends php BCMath lib for missing functions like floor, ceil, round

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by Kacper Rowinski

php math precision bcmath arbitrary-precision round bignumber floor bc ceil rand abs complex-numbers

11/10 2017

v1.3.5

1.3.5.0

Extends php BCMath lib for missing functions like floor, ceil, round

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by Kacper Rowinski

php math precision bcmath arbitrary-precision round bignumber floor bc ceil rand abs complex-numbers

28/08 2017

v1.3.4

1.3.4.0

Extends php BCMath lib for missing functions like floor, ceil, round

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by Kacper Rowinski

php math precision bcmath arbitrary-precision round bignumber floor bc ceil rand abs complex-numbers

23/08 2017

v1.3.3

1.3.3.0

Extends php BCMath lib for missing functions like floor, ceil, round

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by KR

php precision bcmath round bc ceil

30/07 2017

v1.3.2

1.3.2.0

Extends php BCMath lib for missing functions like floor, ceil, round

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by KR

php precision bcmath round bc ceil

22/04 2016

v1.3.1

1.3.1.0

Extends php BCMath lib for missing functions like floor, ceil, round

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by KR

php precision bcmath round bc ceil

31/03 2016

v1.3

1.3.0.0

Extends php BCMath lib for missing functions like floor, ceil, round

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by KR

php precision bcmath round bc ceil

31/03 2016

v1.2

1.2.0.0

Extends php BCMath lib for missing functions like floor, ceil, round

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by KR

php precision bcmath round bc ceil

23/03 2016

v1.1

1.1.0.0

Extends php BCMath lib for missing functions like floor, ceil, round

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by KR

php precision bcmath round bc ceil

20/03 2016

v1.0

1.0.0.0

Extends php BCMath lib for missing functions like floor, ceil, round

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by KR

php precision bcmath round bc ceil