math-exercises 1.3.66 → 1.3.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/calcul/arithmetics/euclideanDivision.js +1 -1
- package/lib/exercises/calcul/arithmetics/primeNumbers.js +1 -1
- package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.js +1 -1
- package/lib/exercises/calcul/rounding/rounding.d.ts.map +1 -1
- package/lib/exercises/calcul/rounding/rounding.js +0 -1
- package/lib/exercises/derivation/derivative/constanteDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/constanteDerivative.js +7 -2
- package/lib/exercises/derivation/derivative/expDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/expDerivativeOne.js +8 -18
- package/lib/exercises/derivation/derivative/expDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/expDerivativeThree.js +8 -17
- package/lib/exercises/derivation/derivative/expDerivativeTwo.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/expDerivativeTwo.js +6 -2
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.js +7 -2
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.js +8 -2
- package/lib/exercises/derivation/derivative/lnDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/lnDerivativeOne.js +16 -20
- package/lib/exercises/derivation/derivative/lnDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/lnDerivativeThree.js +14 -5
- package/lib/exercises/derivation/derivative/lnDerivativeTwo.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/lnDerivativeTwo.js +8 -2
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.js +7 -2
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.js +7 -2
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.js +5 -1
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.js +5 -1
- package/lib/exercises/exercise.d.ts +1 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercise.js +13 -0
- package/lib/exercises/exercises.d.ts.map +1 -1
- package/lib/exercises/exercises.js +6 -0
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.js +0 -1
- package/lib/exercises/limits/polynomeLimit.js +2 -2
- package/lib/exercises/limits/sequenceGeometricLimit.d.ts +4 -0
- package/lib/exercises/limits/sequenceGeometricLimit.d.ts.map +1 -0
- package/lib/exercises/limits/sequenceGeometricLimit.js +51 -0
- package/lib/exercises/limits/sequencePolynomLimit.d.ts.map +1 -1
- package/lib/exercises/limits/sequencePolynomLimit.js +9 -7
- package/lib/exercises/limits/sequencePolynomNoFILimit.d.ts +4 -0
- package/lib/exercises/limits/sequencePolynomNoFILimit.d.ts.map +1 -0
- package/lib/exercises/limits/sequencePolynomNoFILimit.js +66 -0
- package/lib/exercises/limits/sequencePolynomProductLimit.d.ts +4 -0
- package/lib/exercises/limits/sequencePolynomProductLimit.d.ts.map +1 -0
- package/lib/exercises/limits/sequencePolynomProductLimit.js +74 -0
- package/lib/exercises/limits/sequenceRationalFracLimit.d.ts.map +1 -1
- package/lib/exercises/limits/sequenceRationalFracLimit.js +12 -8
- package/lib/exercises/limits/sequenceSimpleElementsSumLimit.d.ts +4 -0
- package/lib/exercises/limits/sequenceSimpleElementsSumLimit.d.ts.map +1 -0
- package/lib/exercises/limits/sequenceSimpleElementsSumLimit.js +65 -0
- package/lib/exercises/primitve/exponentialPrimitive.js +1 -1
- package/lib/exercises/primitve/logarithmePrimitive.js +2 -2
- package/lib/exercises/primitve/polynomialPrimitive.js +2 -2
- package/lib/exercises/primitve/sinCosPrimitive.js +1 -1
- package/lib/exercises/probaStat/quartiles.d.ts.map +1 -1
- package/lib/exercises/probaStat/quartiles.js +0 -1
- package/lib/exercises/sets/intervals/inequalityToInterval.js +3 -3
- package/lib/math/numbers/decimals/decimal.d.ts +1 -1
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +2 -1
- package/lib/math/numbers/rationals/rational.d.ts +1 -0
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.js +10 -0
- package/lib/math/polynomials/polynomial.d.ts +2 -1
- package/lib/math/polynomials/polynomial.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.js +41 -13
- package/lib/math/sequences/geometricSequence.d.ts +11 -1
- package/lib/math/sequences/geometricSequence.d.ts.map +1 -1
- package/lib/math/sequences/geometricSequence.js +65 -2
- package/lib/tree/nodes/operators/multiplyNode.js +1 -1
- package/lib/tree/nodes/operators/powerNode.js +1 -1
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ const lcd_1 = require("../../../math/utils/arithmetic/lcd");
|
|
|
7
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
8
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
9
9
|
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
10
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
10
11
|
const random_1 = require("../../../utils/random");
|
|
11
12
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
12
13
|
const integer_1 = require("../integer/integer");
|
|
@@ -34,6 +35,15 @@ class RationalConstructor {
|
|
|
34
35
|
const [num, denum] = (0, shuffle_1.shuffle)([a, b]);
|
|
35
36
|
return new Rational(num, denum);
|
|
36
37
|
}
|
|
38
|
+
static randomIrreductibleWithSign(max = 11) {
|
|
39
|
+
const sign = (0, coinFlip_1.coinFlip)() ? 1 : -1;
|
|
40
|
+
const a = (0, randint_1.randint)(2, max);
|
|
41
|
+
const b = (0, random_1.random)([...(0, coprimesOf_1.coprimesOf)(a), 1]);
|
|
42
|
+
if (b === 1)
|
|
43
|
+
return new Rational(sign * b, a);
|
|
44
|
+
const [num, denum] = (0, shuffle_1.shuffle)([a, b]);
|
|
45
|
+
return new Rational(sign * num, denum);
|
|
46
|
+
}
|
|
37
47
|
}
|
|
38
48
|
exports.RationalConstructor = RationalConstructor;
|
|
39
49
|
class Rational {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Node } from '../../tree/nodes/node';
|
|
2
|
-
export declare function createRandomPolynomialWithOrder(order: number, variable?: string): Polynomial;
|
|
3
2
|
export declare abstract class PolynomialConstructor {
|
|
4
3
|
static randomWithOrder(order: number, variable?: string): Polynomial;
|
|
5
4
|
static random(maxOrder: number, variable?: string): Polynomial;
|
|
5
|
+
static randomWithLength(maxOrder: number, length: number, variable?: string): Polynomial;
|
|
6
|
+
static randomWithLengthAndSameSigns(maxOrder: number, length: number, variable?: string): Polynomial;
|
|
6
7
|
}
|
|
7
8
|
export declare class Polynomial {
|
|
8
9
|
degree: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polynomial.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/polynomial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"polynomial.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/polynomial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAW7C,8BAAsB,qBAAqB;IACzC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IAa5D,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IActD,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IAmBhF,MAAM,CAAC,4BAA4B,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;CAmB7F;AAED,qBAAa,UAAU;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;IAEvB;;;;OAIG;gBACS,YAAY,EAAE,MAAM,EAAE,EAAE,QAAQ,GAAE,MAAY;IAS1D,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO;IAG9B,QAAQ,IAAI,MAAM,EAAE;IA8BpB,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAc9B,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU;IAM7B,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAkBnC,QAAQ,IAAI,UAAU;IAOtB,QAAQ,IAAI,UAAU;IAQtB,SAAS,IAAI,UAAU;IAMvB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAM5B,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM;IAiB7C,MAAM,IAAI,IAAI;IAmCd,KAAK,IAAI,MAAM;IAkBf,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Polynomial = exports.PolynomialConstructor =
|
|
3
|
+
exports.Polynomial = exports.PolynomialConstructor = void 0;
|
|
4
4
|
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
5
5
|
const addNode_1 = require("../../tree/nodes/operators/addNode");
|
|
6
6
|
const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
|
|
@@ -8,18 +8,7 @@ const oppositeNode_1 = require("../../tree/nodes/functions/oppositeNode");
|
|
|
8
8
|
const powerNode_1 = require("../../tree/nodes/operators/powerNode");
|
|
9
9
|
const variableNode_1 = require("../../tree/nodes/variables/variableNode");
|
|
10
10
|
const randint_1 = require("../../math/utils/random/randint");
|
|
11
|
-
|
|
12
|
-
if (order < 0) {
|
|
13
|
-
throw Error('Order must be a non-negative integer');
|
|
14
|
-
}
|
|
15
|
-
const coefficients = [];
|
|
16
|
-
for (let i = 0; i <= order - 1; i++) {
|
|
17
|
-
coefficients.push((0, randint_1.randint)(-9, 10));
|
|
18
|
-
}
|
|
19
|
-
coefficients.push((0, randint_1.randint)(-9, 10, [0]));
|
|
20
|
-
return new Polynomial(coefficients, variable);
|
|
21
|
-
}
|
|
22
|
-
exports.createRandomPolynomialWithOrder = createRandomPolynomialWithOrder;
|
|
11
|
+
const coinFlip_1 = require("../../utils/coinFlip");
|
|
23
12
|
class PolynomialConstructor {
|
|
24
13
|
static randomWithOrder(order, variable = 'x') {
|
|
25
14
|
if (order < 0) {
|
|
@@ -44,6 +33,45 @@ class PolynomialConstructor {
|
|
|
44
33
|
coefficients.push((0, randint_1.randint)(-9, 10, [0]));
|
|
45
34
|
return new Polynomial(coefficients, variable);
|
|
46
35
|
}
|
|
36
|
+
static randomWithLength(maxOrder, length, variable = 'x') {
|
|
37
|
+
if (maxOrder < 0) {
|
|
38
|
+
throw Error('Order must be a non-negative integer');
|
|
39
|
+
}
|
|
40
|
+
const order = (0, randint_1.randint)(1, maxOrder + 1);
|
|
41
|
+
const coefficients = [];
|
|
42
|
+
const otherTermDegrees = [];
|
|
43
|
+
for (let i = 0; i < length - 1; i++) {
|
|
44
|
+
otherTermDegrees.push((0, randint_1.randint)(0, order));
|
|
45
|
+
}
|
|
46
|
+
for (let i = 0; i <= order - 1; i++) {
|
|
47
|
+
if (otherTermDegrees.includes(i))
|
|
48
|
+
coefficients.push((0, randint_1.randint)(-9, 10, [0]));
|
|
49
|
+
else
|
|
50
|
+
coefficients.push(0);
|
|
51
|
+
}
|
|
52
|
+
coefficients.push((0, randint_1.randint)(-9, 10, [0]));
|
|
53
|
+
return new Polynomial(coefficients, variable);
|
|
54
|
+
}
|
|
55
|
+
static randomWithLengthAndSameSigns(maxOrder, length, variable = 'x') {
|
|
56
|
+
if (maxOrder < 0) {
|
|
57
|
+
throw Error('Order must be a non-negative integer');
|
|
58
|
+
}
|
|
59
|
+
const order = (0, randint_1.randint)(1, maxOrder + 1);
|
|
60
|
+
const coefficients = [];
|
|
61
|
+
const otherTermDegrees = [];
|
|
62
|
+
const sign = (0, coinFlip_1.coinFlip)() ? 1 : -1;
|
|
63
|
+
for (let i = 0; i < length - 1; i++) {
|
|
64
|
+
otherTermDegrees.push((0, randint_1.randint)(0, order));
|
|
65
|
+
}
|
|
66
|
+
for (let i = 0; i <= order - 1; i++) {
|
|
67
|
+
if (otherTermDegrees.includes(i))
|
|
68
|
+
coefficients.push(sign * (0, randint_1.randint)(0, 10, [0]));
|
|
69
|
+
else
|
|
70
|
+
coefficients.push(0);
|
|
71
|
+
}
|
|
72
|
+
coefficients.push(sign * (0, randint_1.randint)(0, 10, [0]));
|
|
73
|
+
return new Polynomial(coefficients, variable);
|
|
74
|
+
}
|
|
47
75
|
}
|
|
48
76
|
exports.PolynomialConstructor = PolynomialConstructor;
|
|
49
77
|
class Polynomial {
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import { MultiplyNode } from '../../tree/nodes/operators/multiplyNode';
|
|
2
|
+
import { Nombre, NumberType } from '../numbers/nombre';
|
|
1
3
|
export declare abstract class GeometricSequenceConstructor {
|
|
2
|
-
static random():
|
|
4
|
+
static random(reasonType?: NumberType): GeometricSequence;
|
|
5
|
+
static randomWithLimit(reasonType?: NumberType): GeometricSequence;
|
|
6
|
+
}
|
|
7
|
+
export declare class GeometricSequence {
|
|
8
|
+
firstTerm: Nombre;
|
|
9
|
+
reason: Nombre;
|
|
10
|
+
constructor(firstTerm: Nombre, reason: Nombre);
|
|
11
|
+
getLimit(): string | null;
|
|
12
|
+
toTree(): MultiplyNode;
|
|
3
13
|
}
|
|
4
14
|
//# sourceMappingURL=geometricSequence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricSequence.d.ts","sourceRoot":"","sources":["../../../src/math/sequences/geometricSequence.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"geometricSequence.d.ts","sourceRoot":"","sources":["../../../src/math/sequences/geometricSequence.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAOvE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIvD,8BAAsB,4BAA4B;IAChD,MAAM,CAAC,MAAM,CAAC,UAAU,GAAE,UAA+B;IAkBzD,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,UAAU;CAmB/C;AAED,qBAAa,iBAAiB;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;gBAEH,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAK7C,QAAQ;IAMR,MAAM;CAGP"}
|
|
@@ -1,8 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GeometricSequenceConstructor = void 0;
|
|
3
|
+
exports.GeometricSequence = exports.GeometricSequenceConstructor = void 0;
|
|
4
|
+
const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
|
|
5
|
+
const powerNode_1 = require("../../tree/nodes/operators/powerNode");
|
|
6
|
+
const variableNode_1 = require("../../tree/nodes/variables/variableNode");
|
|
7
|
+
const coinFlip_1 = require("../../utils/coinFlip");
|
|
8
|
+
const random_1 = require("../../utils/random");
|
|
9
|
+
const decimal_1 = require("../numbers/decimals/decimal");
|
|
10
|
+
const integer_1 = require("../numbers/integer/integer");
|
|
11
|
+
const nombre_1 = require("../numbers/nombre");
|
|
12
|
+
const rational_1 = require("../numbers/rationals/rational");
|
|
13
|
+
const randint_1 = require("../utils/random/randint");
|
|
4
14
|
class GeometricSequenceConstructor {
|
|
5
|
-
static random() {
|
|
15
|
+
static random(reasonType = nombre_1.NumberType.Integer) {
|
|
16
|
+
let reason;
|
|
17
|
+
const type = reasonType ?? (0, random_1.random)([nombre_1.NumberType.Decimal, nombre_1.NumberType.Integer, nombre_1.NumberType.Rational]);
|
|
18
|
+
switch (type) {
|
|
19
|
+
case nombre_1.NumberType.Decimal:
|
|
20
|
+
reason = decimal_1.DecimalConstructor.random(-9, 10);
|
|
21
|
+
break;
|
|
22
|
+
case nombre_1.NumberType.Integer:
|
|
23
|
+
reason = new integer_1.Integer((0, randint_1.randint)(-9, 10, [0, 1]));
|
|
24
|
+
break;
|
|
25
|
+
case nombre_1.NumberType.Rational:
|
|
26
|
+
reason = rational_1.RationalConstructor.randomIrreductible();
|
|
27
|
+
break;
|
|
28
|
+
case nombre_1.NumberType.Real:
|
|
29
|
+
throw Error('real geometric reason not supported yet');
|
|
30
|
+
}
|
|
31
|
+
return new GeometricSequence(new integer_1.Integer((0, randint_1.randint)(-9, 10, [0, 1])), reason);
|
|
32
|
+
}
|
|
33
|
+
static randomWithLimit(reasonType) {
|
|
34
|
+
let reason;
|
|
35
|
+
const type = reasonType ?? (0, random_1.random)([nombre_1.NumberType.Decimal, nombre_1.NumberType.Integer, nombre_1.NumberType.Rational]);
|
|
36
|
+
switch (type) {
|
|
37
|
+
case nombre_1.NumberType.Decimal:
|
|
38
|
+
reason = (0, coinFlip_1.coinFlip)() ? decimal_1.DecimalConstructor.random(-1, 1) : decimal_1.DecimalConstructor.random(1, 10);
|
|
39
|
+
break;
|
|
40
|
+
case nombre_1.NumberType.Integer:
|
|
41
|
+
reason = new integer_1.Integer((0, randint_1.randint)(2, 10, [0, 1]));
|
|
42
|
+
break;
|
|
43
|
+
case nombre_1.NumberType.Rational:
|
|
44
|
+
reason = rational_1.RationalConstructor.randomIrreductible();
|
|
45
|
+
break;
|
|
46
|
+
case nombre_1.NumberType.Real:
|
|
47
|
+
throw Error('real geometric reason not supported yet');
|
|
48
|
+
}
|
|
49
|
+
return new GeometricSequence(new integer_1.Integer((0, randint_1.randint)(-9, 10, [0, 1])), reason);
|
|
6
50
|
}
|
|
7
51
|
}
|
|
8
52
|
exports.GeometricSequenceConstructor = GeometricSequenceConstructor;
|
|
53
|
+
class GeometricSequence {
|
|
54
|
+
constructor(firstTerm, reason) {
|
|
55
|
+
this.firstTerm = firstTerm;
|
|
56
|
+
this.reason = reason;
|
|
57
|
+
}
|
|
58
|
+
getLimit() {
|
|
59
|
+
if (this.reason.value < -1)
|
|
60
|
+
return null;
|
|
61
|
+
if (this.reason.value === 1 || this.reason.value === -1)
|
|
62
|
+
return this.firstTerm + '';
|
|
63
|
+
if (this.reason.value > 1)
|
|
64
|
+
return this.firstTerm.value > 0 ? '+\\infty' : '-\\infty';
|
|
65
|
+
return '0';
|
|
66
|
+
}
|
|
67
|
+
toTree() {
|
|
68
|
+
return new multiplyNode_1.MultiplyNode(this.firstTerm.toTree(), new powerNode_1.PowerNode(this.reason.toTree(), new variableNode_1.VariableNode('n')));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.GeometricSequence = GeometricSequence;
|
|
@@ -41,7 +41,7 @@ class MultiplyNode extends operatorNode_1.OperatorNode {
|
|
|
41
41
|
let showTimesSign = !isNaN(+rightTex[0]) || this.rightChild.type === node_1.NodeType.number;
|
|
42
42
|
if (this.rightChild.type === node_1.NodeType.operator) {
|
|
43
43
|
const operatorRightChild = this.rightChild;
|
|
44
|
-
showTimesSign ||= [operatorNode_1.OperatorIds.fraction].includes(operatorRightChild.id);
|
|
44
|
+
showTimesSign ||= [operatorNode_1.OperatorIds.fraction, operatorNode_1.OperatorIds.power].includes(operatorRightChild.id);
|
|
45
45
|
}
|
|
46
46
|
const nextIsLetter = rightTex[0].toLowerCase() !== rightTex[0].toUpperCase();
|
|
47
47
|
return `${leftTex}${showTimesSign ? `\\times${nextIsLetter ? ' ' : ''}` : ''}${rightTex}`;
|
|
@@ -27,7 +27,7 @@ class PowerNode extends operatorNode_1.OperatorNode {
|
|
|
27
27
|
].includes(childOperator.id);
|
|
28
28
|
}
|
|
29
29
|
if (needBrackets)
|
|
30
|
-
leftTex =
|
|
30
|
+
leftTex = `\\left(${leftTex}\\right)`;
|
|
31
31
|
const needBrace = rightTex.length > 1;
|
|
32
32
|
if (needBrace)
|
|
33
33
|
return `${leftTex}^{${rightTex}}`;
|