Skip to content

Commit 9d7fe50

Browse files
authored
fix: latexise for product of a number and a numeric power base
1 parent 726a3d8 commit 9d7fe50

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Sources/AngouriMath/AngouriMath/Functions/Output/Latex/Latex.Arithmetics.Classes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public override string Latexise()
4040
{
4141
(Integer(-1), Complex n) => (-n).Latexise(parenthesesRequired: false),
4242
(Integer(-1), var other) => $"-{other.Latexise(other.Priority < Priority)}",
43-
(Number a, Number b) => $@"{a.Latexise(a.Priority < Priority)} \cdot {b.Latexise(b.Priority < Priority)}",
43+
(Number a, (Number or Powf(Number, _)) and var b) => $@"{a.Latexise(a.Priority < Priority)} \cdot {b.Latexise(b.Priority < Priority)}",
4444
(var mp, var md) when mp.Priority >= md.Priority => $@"{mp.Latexise(mp.Priority < Priority)} {md.Latexise(md.Priority < Priority)}",
4545
(var mp, var md) => $@"{mp.Latexise(mp.Priority < Priority)} \cdot {md.Latexise(md.Priority < Priority)}"
4646
},

Sources/Tests/UnitTests/Convenience/LatexTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ [Fact] public void Piecewise2()
271271
=> Test(@"\begin{cases}a \: \text{for} \: b\\c \: \text{for} \: e\\g \: \text{otherwise}\end{cases}", MathS.Piecewise(("a", "b"), ("c", "e"), ("g", true)));
272272
[Fact] public void M1InTheMiddle()
273273
=> Test(@"x \cdot \left(-1\right) \cdot x", (x * (-1)) * x);
274+
[Fact] public void MultiplyNumberWithPower() => Test(@"2 \cdot {3}^{4}", 2 * ((Entity)3).Pow(4));
274275
}
275276
}
276277

0 commit comments

Comments
 (0)