Skip to content

Releases: JordanRL/Fermat

v2.1.1

30 Jun 01:11
876446a
Compare
Choose a tag to compare

Added

  • RandomProvider: A provider to supply random numbers.
    • randomInt(): Supplies a random integer.
    • randomDecimal(): Supplies a random decimal between 0 and 1 (inclusive)
    • randomReal(): Supplies a random real number.

Changed

  • Composer: Removed dependency on ircmaxell/random-lib, as it was outdated and is now replaced with Fermat's RandomProvider.

v2.1.0

27 Jun 08:59
61234b6
Compare
Choose a tag to compare

Added

  • NumberCollection: Added the method selectScale() to return the int value of the largest scale among all collection members.

v2.0.1

26 Jun 23:13
Compare
Choose a tag to compare

Fixed

  • Composer: Fixed an issue with dependencies that created errors for libraries which include this as a dependency.

v2.0.0

26 Jun 22:04
e4dfa39
Compare
Choose a tag to compare

Moved to a module based system, resulting in many of these changes being moved to separate repositories. Please consult the README.md file for more details.

Added

  • Providers:
    • Distributions:
      • Base: Distribution abstract class
    • ArithmeticProvider:
      • Added a scale argument to all methods that were missing it.
    • PolyfillProvider
    • SequenceProvider:
      • nthFibonacciNumber function
    • StatsProvider:
      • Added docblocks for all methods
      • Added gammaFunction function
  • Types:
    • Base:
      • Interfaces:
        • BaseConversionInterface
        • ComplexInterface
        • DecimalInterface:
          • Added hyperbolic trig functions
          • Added exp()
        • NumberInterface:
          • Added isComplex(): bool method
        • MatrixInterface
        • NumberCollectionInterface
      • Number:
        • numberOfTotalDigits()
        • numberOfIntDigits()
        • numberOfDecimalDigits()
        • numberOfSigDecimalDigits()
        • isComplex()
        • asComplex()
    • Traits:
      • ArithmeticTrait
      • ComparisonTrait
      • IntegerMathTrait
      • InverseTrigonometryTrait
      • LogTrait
      • ScaleTrait
      • TrigonometryTrait:
        • Added implementation of hyperbolic trig functions
    • ComplexNumber
    • Coordinate
    • Decimal
    • Expression
    • Matrix
    • NumberCollection
  • Values:
    • Algebra
      • PolynomialFunction
    • Geometry
      • CoordinateSystems
        • CartesianCoordinate
        • CylindricalCoordinate
        • PolarCoordinate
        • SphericalCoordinate
    • ImmutableComplexNumber
    • ImmutableFraction:
      • Added implementation of isComplex(): bool
    • ImmutableMatrix
    • ImmutableNumber:
      • Added implementation of isComplex(): bool
    • MutableComplexNumber
    • MutableFraction:
      • Added implementation of isComplex(): bool
    • MutableMatrix
    • MutableNumber:
      • Added implementation of isComplex(): bool
  • Factories:
    • Collections
    • ComplexNumbers
    • Matrices

Removed

  • Composer:
    • Suggested:
      • ext-stats: * (As this library is no longer maintained and unavailable on PHP 7+, it is being removed)
  • Providers:
    • SequenceProvider
      • Removed empty nthSecTanCoefNumber function until an implementation exists

Changed

  • Providers:
    • Distributions:
      • Removed references to ext-stats in all distributions
      • Fixed missing @throws in docblocks in all distributions
      • Now extend Distribution abstract class
      • Use the randomInt() method in PolyfillProvider instead of RandomLib directly
    • SequenceProvider:
      • Allowed nthEvenNumber(), nthOddNumber(), nthPowerNegativeOne(), nthEulerZigzag(), and nthFibonacciNumber() to return windows of the sequence as a NumberCollection object
  • Types:
    • Base:
      • Interfaces:
        • ALL: Changed namespace from Samsara\Fermat\Types\Base to Samsara\Fermat\Types\Base\Interfaces
        • DecimalInterface:
          • Changed signature of log10() and ln() to $scale = null instead of $scale = 10
          • Changed type of $scale parameter in log10() and ln() from int to int|null
        • NumberInterface:
          • Moved the convertToBase() method to the new BaseConversionInterface
      • Traits:
        • ArithmeticTrait:
          • Updated all arithmetic functions to work with imaginary numbers, complex numbers, and negative numbers (square root)
      • Number:
        • Changed namespace from Samsara\Fermat\Types to Samsara\Fermat\Types\Base
        • Moved many methods into traits
        • Now passes the scale setting to ALL calls to ArithmeticProvider allowing scale up to 2147483646 digits.
        • Trig functions are now arbitrary scale
        • numberOfLeadingZeros() now returns int type, as was originally intended
    • Fraction:
      • Moved many methods into traits

Fixed

  • Providers:
    • Distributions:
      • Exponential:
        • Fixed accidental cast to float in random function
    • SequenceProvider:
      • Fixed erroneous limit on Euler Zigzag sequence index (45 -> 50) and updated exception to reflect current limit (39 -> 50)
  • Types:
    • Traits:
      • LogTrait:
        • Fixed $scale to work the way it does in other functions for log10() and ln()
    • Tuple:
      • Changed the constructor so that it properly works with either parameter collection or a single array
    • ImmutableNumber:
      • Fixed the problem with scale in continuousModulo()
    • MutableNumber:
      • Fixed the problem with scale in continuousModulo()

v1.0.2

16 Jan 21:59
Compare
Choose a tag to compare

Fixed

  • DecimalInterface
    • Added the following to correctly reflect usage:
      • tan()
      • cot()
      • sec()
      • csc()
      • arcsin()
      • arccos()
      • arctan()
      • arccot()
      • arcsec()
      • arccsc()

v1.0.1

16 Jan 09:01
Compare
Choose a tag to compare

Changed

  • Composer
    • Dependencies:
      • samsara/common: dev-master -> 1.*

v1.0.0

16 Jan 03:12
Compare
Choose a tag to compare

Added

  • Composer
    • Dependencies:
      • riimu/kit-baseconversion: v1.*
      • ircmaxell/random-lib: v1.1.*
      • php-ds/php-ds: v1.1.*
      • samsara/common: dev-master
      • ext-bcmath: *
    • Dev Dependencies:
      • phpunit/phpunit: v5.7.*
    • Suggested:
      • ext-ds: *
      • ext-stats: * (NOTE: This extension can't be used because it is not available for PHP 7+)
      • ext-gmp: *
  • Types:
    • Interfaces:
      • CoordinateInterface
      • DecimalInterface
      • FractionInterface
      • NumberInterface
    • Fraction
    • Number
    • Tuple
  • Numbers:
    • CartesianCoordinate
    • Currency
    • ImmutableFraction
    • ImmutableNumber
    • MutableFraction
    • MutableNumber
  • Providers:
    • Distributions:
      • Exponential
      • Normal
      • Poisson
    • ArithmeticProvider
    • SequenceProvider
    • SeriesProvider
    • StatsProvider
    • TrigonometryProvider