diff --git a/AbMath/AbMath.dll b/AbMath/AbMath.dll index e9b94ce..b9a46d4 100644 Binary files a/AbMath/AbMath.dll and b/AbMath/AbMath.dll differ diff --git a/AbMath/Calculator/Tokenizer.cs b/AbMath/Calculator/Tokenizer.cs index 3841a96..697e82f 100644 --- a/AbMath/Calculator/Tokenizer.cs +++ b/AbMath/Calculator/Tokenizer.cs @@ -76,6 +76,11 @@ public List Tokenize() WriteToken("Unary"); } } + else if (_dataStore.IsNumber( _character ) && _token == "-.") + { + _rule = "Decimal Append"; + _token += _character; + } else if ( ( _dataStore.IsNumber(_token) ) && ( _dataStore.IsVariable(_character) || _dataStore.IsLeftBracket(_character) || _dataStore.IsFunction(_character))) { WriteToken("Left Implicit"); diff --git a/Unit Tester/Apportionment/Utilities/Reverse Polish Notation/PostFix.cs b/Unit Tester/Apportionment/Utilities/Reverse Polish Notation/PostFix.cs index d5eb298..2b779ce 100644 --- a/Unit Tester/Apportionment/Utilities/Reverse Polish Notation/PostFix.cs +++ b/Unit Tester/Apportionment/Utilities/Reverse Polish Notation/PostFix.cs @@ -75,6 +75,16 @@ public void UnarySubtract2() Assert.AreEqual(3, math.Compute()); } + [Test] + public void UnaryDecimal() + { + test.SetEquation("-.5 + .5"); + + test.Compute(); + PostFix math = new PostFix(test); + Assert.AreEqual(0, math.Compute()); + } + [Test] public void Sin() {