Releases: bartgora/RPNLibrary
Releases · bartgora/RPNLibrary
5.0.0
- 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
Using big Decimal Math library (https://github.com/eobermuhlner/big-math)
General refactoring.
Added Javadoc
3.2.2
3.2.1
3.2.1-SNAPSHOT
3.2.0
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);
}