php-bignumbers icon indicating copy to clipboard operation
php-bignumbers copied to clipboard

[WIP] Add important numerical constants

Open castarco opened this issue 9 years ago • 1 comments

A list of important numerical constants.

Interfaces

  • [X] Zero
  • [X] One
  • [X] PI
  • [X] E
  • [X] Euler - Mascheroni Constant
  • [X] Golden Ratio
  • [ ] Silver Ratio
  • [X] Light Speed

Arbitrary precision (via $scale parameter)

  • [ ] PI
  • [X] E
  • [ ] Euler - Mascheroni Constant
  • [ ] Golden Ratio
  • [ ] Silver Ratio

Integration with Decimal

  • [X] Use the Zero constant instead of creating new zero objects inside Decimal methods.
  • [X] Use the One constant instead of creating new one objects inside Decimal methods.

The non-phisical numerical constants must be associated to a method with the following signature:

public static function ConstantName($scale);

This methods will allow to specify how many digits we want for every one of the supported numerical constants.

castarco avatar Mar 08 '15 20:03 castarco

Hi @castarco, I create PR to add silver ratio.

agungsantoso avatar Mar 30 '16 09:03 agungsantoso