-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I think that's everything. Exponent order not working.
There's some crazy logic about putting sequential exponents in the right order I can't figure out.
- Loading branch information
Stephen Graham
committed
Oct 27, 2023
1 parent
9659708
commit 3f0284d
Showing
15 changed files
with
229 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
// <copyright file="AdditionNode.cs" company="Stephen Graham - 011706998"> | ||
// Copyright (c) Stephen Graham - 011706998. All rights reserved. | ||
// </copyright> | ||
|
||
namespace SpreadsheetEngine | ||
{ | ||
class AdditionNode : OperatorNode | ||
/// <summary> | ||
/// addition operator node. | ||
/// </summary> | ||
internal class AdditionNode : OperatorNode | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="AdditionNode"/> class. | ||
/// </summary> | ||
public AdditionNode() | ||
: base("+") | ||
{ | ||
this.Precidence = 1; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override double Evaluate() | ||
{ | ||
return Expression.Evaluate(this.Left) + Expression.Evaluate(this.Right); | ||
return ExpressionTree.Evaluate(this.Left) + ExpressionTree.Evaluate(this.Right); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
// <copyright file="DivisionNode.cs" company="Stephen Graham - 011706998"> | ||
// Copyright (c) Stephen Graham - 011706998. All rights reserved. | ||
// </copyright> | ||
|
||
namespace SpreadsheetEngine | ||
{ | ||
class DivisionNode : OperatorNode | ||
/// <summary> | ||
/// division operator node. | ||
/// </summary> | ||
internal class DivisionNode : OperatorNode | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="DivisionNode"/> class. | ||
/// </summary> | ||
public DivisionNode() | ||
{ | ||
this.Precidence = 2; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override double Evaluate() | ||
{ | ||
return Expression.Evaluate(this.Left) / Expression.Evaluate(this.Right); | ||
return ExpressionTree.Evaluate(this.Left) / ExpressionTree.Evaluate(this.Right); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
// <copyright file="ExponentNode.cs" company="Stephen Graham - 011706998"> | ||
// Copyright (c) Stephen Graham - 011706998. All rights reserved. | ||
// </copyright> | ||
|
||
namespace SpreadsheetEngine | ||
{ | ||
class ExponentNode : OperatorNode | ||
/// <summary> | ||
/// exponent operator node. | ||
/// </summary> | ||
internal class ExponentNode : OperatorNode | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ExponentNode"/> class. | ||
/// </summary> | ||
public ExponentNode() | ||
{ | ||
this.Precidence = 3; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override double Evaluate() | ||
{ | ||
return System.Math.Pow(Expression.Evaluate(this.Left), Expression.Evaluate(this.Right)); | ||
return System.Math.Pow(ExpressionTree.Evaluate(this.Left), ExpressionTree.Evaluate(this.Right)); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.