Skip to content

Releases: bartgora/RPNLibrary

5.0.0

23 Jun 13:55
50213b9
Compare
Choose a tag to compare
  • Moved to java 8
  • Refactoring, split Calculator class into smaller pieces, using java 8 functional interfaces
  • Added tests written in Kotest:
    example:
class RPNFactoryTest : FreeSpec({

    val tested = RPNFactory(RPNChecker(DefaultStrategyProvider()))
            "should Return RPN" - {
                val text = "( 2 + 3 ) * 5"
                val result = tested.apply(text)
                result shouldBe "2 3 + 5 *"
            }
            "should Return RPN for Function call" - {
                val text = "sin ( 1 )"
                val result = tested.apply(text)
                result shouldBe "1 sin"
            }
            "should Return RPN for Function and equation" - {
                val text = "sin ( 1 ) + 27 * 8"
                val result = tested.apply(text)
                result shouldBe "1 sin 27 8 * +"
            }
            "should Return RPN for  two Functions call" - {
                val text = "sin ( 1 ) + ctg ( 0 )"
                val result = tested.apply(text)
                result shouldBe "1 sin 0 ctg +"
            }
})

4.0.0

15 Apr 13:50
74b9bc3
Compare
Choose a tag to compare

Using big Decimal Math library (https://github.com/eobermuhlner/big-math)
General refactoring.
Added Javadoc

3.2.2

19 Jul 13:59
Compare
Choose a tag to compare
  • Changed internal calculation from BigDecimal to Double in DefaultCalculator implementation.
  • Some Refactoring

Download RPNLibrary

3.2.1

15 Jul 08:42
Compare
Choose a tag to compare
  • Fixed bug in divide operator, that caused:
    ex: "10/4 = 2, and not 2.5",
    "5/2 = 2, and not 2.5"
  • Changed RoundinMode from HALF_UP, to HALF_EVEN
  • Changed internal calculation type from BigDecimal to Double

Download RPNLibrary

3.2.1-SNAPSHOT

14 Jul 16:16
Compare
Choose a tag to compare
  • Fixed bug in divide operator, that caused:
    ex: "10/4 = 2, and not 2.5",
    "5/2 = 2, and not 2.5"
  • Changed RoundinMode from HALF_UP, to HALF_EVEN
  • Changed internal calculation type from BigDecimal to Double

Download RPNLibrary

3.2.0

23 Jun 21:39
Compare
Choose a tag to compare

Version 3.2.0:

IMPORTANT:

Changed package names from

    pl.bgora.rpn

to

com.github.bgora.rpnlibrary

Fixed bug, that prevented from exucuting functions with multiple parameters.

New functions:

max() - takes two parameters, returns greater one

min() - take two parameters, returns less one

fib() - Fibonacci number

Refactor:

Changed createCalulator, and getDefaultEngine to use CalculationEngine interface

    /**
     * Creates AdvanceCalculator with given CalculatorEngine
     *
     * @param engine CalculationEngine implementation
     * @return AdvanceCalculator
     */
    public CalculatorInterface createCalulator(CalculationEngine engine) {
        return new AdvancedCalculator(RoundingMode.HALF_UP, engine);
    }


    /**
     * Return default CalculationEngine implementation
     *
     * @return CalculatorEngine
     */
    public CalculationEngine getDefaultEngine() {
        return new CalculatorEngine(StrategiesUtil.DEFAULT_OPERATORS, StrategiesUtil.DEFAULT_FUNCTIONS);
    }

Download RPNLibrary

3.1.0

14 Jun 10:50
Compare
Choose a tag to compare

Added advanced calculator.
Setup for maven central.

Added AdvancedCalultor using Strategies for Operators, and Functions

Download RPNLibrary

3.0.0

08 Apr 14:04
Compare
Choose a tag to compare

The new Java RPN Library with some bug fixes and changed API.

Download RPNLibrary