Skip to content

Commit 7cc30ca

Browse files
Refactored a little bit
1 parent ab17094 commit 7cc30ca

10 files changed

Lines changed: 23 additions & 16 deletions

File tree

AngouriMath/AngouriMath.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
<Copyright>Angourisoft</Copyright>
99
<PackageProjectUrl>asc-community.org</PackageProjectUrl>
1010
<RepositoryUrl>https://github.com/Angourisoft/MathS</RepositoryUrl>
11-
<AssemblyVersion>0.0.15.0</AssemblyVersion>
12-
<FileVersion>0.0.15.0</FileVersion>
11+
<AssemblyVersion>0.0.16.0</AssemblyVersion>
12+
<FileVersion>0.0.16.0</FileVersion>
1313
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1414
<PackageLicenseExpression></PackageLicenseExpression>
1515
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
1616
<PackageTags>Math, csharp, derivation, latex, calculator, parse, simplification, compute</PackageTags>
17-
<Version>1.0.15.1</Version>
17+
<Version>1.0.16-Beta</Version>
1818
<PackageIconUrl>https://raw.githubusercontent.com/Angourisoft/MathS/master/icon.png</PackageIconUrl>
1919
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
2020
<Description>Enables to work with formulas built in the code or from a string. Computing, derivating, latex rendering, fast functions, and many more.</Description>
21-
<PackageReleaseNotes>Minor changes</PackageReleaseNotes>
21+
<PackageReleaseNotes>New functions added (arc-*), bugs fixed, tests added</PackageReleaseNotes>
2222
<PackageId>AngouriMath</PackageId>
2323
<Product>AngouriMath</Product>
2424
<ApplicationIcon />

AngouriMath/Convenience/MathS.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,20 @@ public static partial class MathS
173173
public static readonly VarFunc Symbol = v => new VariableEntity(v);
174174

175175
/// <summary>
176-
/// Creates an instance of Number (not NumberEntity!)
176+
/// Creates a complex instance of Number (not NumberEntity!)
177177
/// </summary>
178178
/// <param name="a"></param>
179179
/// <param name="b"></param>
180180
/// <returns></returns>
181181
public static Number Num(double a, double b) => new Number(a, b);
182+
183+
/// <summary>
184+
/// Creates a real instance of Number (not NumberEntity!)
185+
/// </summary>
186+
/// <param name="a"></param>
187+
/// <returns></returns>
188+
public static Number Num(double a) => new Number(a);
189+
182190
public static readonly Number e = 2.718281828459045235;
183191
public static readonly Number i = new Number(0, 1);
184192
public static readonly Number pi = 3.141592653589793;

AngouriMath/Core/FromLinq/LinqParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace AngouriMath.Core.FromLinq
77
{
88
internal class LinqParser
99
{
10-
private Expression src;
10+
private readonly Expression src;
1111
internal LinqParser(Expression linq)
1212
{
1313
src = linq;

AngouriMath/Core/Sys/Number.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ public static Number Parse(string s)
149149
internal bool __isReal;
150150
public static implicit operator Number(int num) => new Number(num);
151151
public static implicit operator Number(double num) => new Number(num);
152-
//public static explicit operator Number(double num) => new Number(num);
153152
public static implicit operator Number(Complex num) => new Number(num);
154153
public static Number operator +(Number a, Number b) => new Number(a.value + b.value);
155154
public static Number operator -(Number a, Number b) => new Number(a.value - b.value);

AngouriMath/Functions/Evaluation/Compilation/Instruction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public override string ToString()
4444
if (Type == InstructionType.CALL)
4545
return b + FuncName;
4646
else if (Type == InstructionType.PUSHCONST)
47-
return b + Value.ToString();
47+
return b + Value;
4848
else
4949
return b + VarNumber.ToString();
5050
}

Samples/GraphicExample/GraphicExample/MainForm.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ private void MainFormLoad(object sender, EventArgs e)
2929
niceFunc1 = expr1.Compile(A, B);
3030
niceFunc2 = expr2.Compile(A, B);
3131
}
32-
List<double> X1 = new List<double>();
33-
List<double> Y1 = new List<double>();
34-
List<double> X2 = new List<double>();
35-
List<double> Y2 = new List<double>();
32+
readonly List<double> X1 = new List<double>();
33+
readonly List<double> Y1 = new List<double>();
34+
readonly List<double> X2 = new List<double>();
35+
readonly List<double> Y2 = new List<double>();
3636
private void EveryFrame(object sender, EventArgs e)
3737
{
3838
X1.Clear(); Y1.Clear();

Samples/Samples/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static void Sample11()
8989
}
9090
static void Main(string[] args)
9191
{
92-
92+
Sample1();
9393
}
9494
}
9595
}

Tests/UnitTests/Algebra/SimplifyTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace UnitTests
77
[TestClass]
88
public class SimplifyTest
99
{
10-
public static VariableEntity x = MathS.Var("x");
10+
public readonly static VariableEntity x = MathS.Var("x");
1111
[TestMethod]
1212
public void TestMinus()
1313
{

Tests/UnitTests/Common/CircleTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace UnitTests
77
[TestClass]
88
public class CircleTest
99
{
10-
public static VariableEntity x = MathS.Var("x");
10+
public readonly static VariableEntity x = MathS.Var("x");
1111
[TestMethod]
1212
public void Test1()
1313
{

Tests/UnitTests/Convenience/FromLinqTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace UnitTests
99
[TestClass]
1010
public class FromLinqTest
1111
{
12-
public static VariableEntity x = MathS.Var("x");
12+
public readonly static VariableEntity x = MathS.Var("x");
1313
[TestMethod]
1414
public void Test1()
1515
{

0 commit comments

Comments
 (0)