math-exercises 2.2.55 → 2.2.56
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/math/calcul/proportionality/index.d.ts +1 -0
- package/lib/exercises/math/calcul/proportionality/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/index.js +1 -0
- package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts +8 -0
- package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -0
- package/lib/exercises/math/calcul/proportionality/isTableProportional.js +91 -0
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +0 -1
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -1
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +0 -1
- package/lib/exercises/math/percent/index.d.ts +0 -1
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +0 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts +4 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +17 -5
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +0 -1
- package/lib/index.d.ts +6 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +0 -2
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +0 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uBAAuB,CAAC"}
|
|
@@ -20,3 +20,4 @@ __exportStar(require("./scaleCalculation"), exports);
|
|
|
20
20
|
__exportStar(require("./scaleUsage"), exports);
|
|
21
21
|
__exportStar(require("./isTableProportionalNonInteger"), exports);
|
|
22
22
|
__exportStar(require("./findCoeffInProportionalTableNonIntegers"), exports);
|
|
23
|
+
__exportStar(require("./isTableProportional"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isTableProportional.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/isTableProportional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AA6E5D,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAgBrD,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTableProportional = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randTupleInt_1 = require("../../../../math/utils/random/randTupleInt");
|
|
7
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
|
+
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
9
|
+
const doWhile_1 = require("../../../../utils/doWhile");
|
|
10
|
+
const dollarize_1 = require("../../../../utils/latex/dollarize");
|
|
11
|
+
const mdTable_1 = require("../../../../utils/markdown/mdTable");
|
|
12
|
+
const getInstruction = ({ xValues, yValues }) => {
|
|
13
|
+
return `Le tableau ci-dessous est-il un tableau de proportionnalité ?
|
|
14
|
+
|
|
15
|
+
${(0, mdTable_1.mdTable)([xValues.map((v) => (0, dollarize_1.dollarize)(v)), yValues.map((v) => (0, dollarize_1.dollarize)(v))])}
|
|
16
|
+
|
|
17
|
+
`;
|
|
18
|
+
};
|
|
19
|
+
const getIsTableProportionalQuestion = () => {
|
|
20
|
+
const xValues = (0, randTupleInt_1.randTupleInt)(3, {
|
|
21
|
+
from: 1,
|
|
22
|
+
to: 15,
|
|
23
|
+
allDifferent: true,
|
|
24
|
+
}).sort((a, b) => a - b);
|
|
25
|
+
const isProportionnal = (0, coinFlip_1.coinFlip)();
|
|
26
|
+
const coeff = (0, randint_1.randint)(2, 6);
|
|
27
|
+
const fakeCoeffs = [];
|
|
28
|
+
let yValues = [];
|
|
29
|
+
if (isProportionnal) {
|
|
30
|
+
yValues = xValues.map((value) => value * coeff);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
xValues.forEach((x) => {
|
|
34
|
+
const newCoeff = (0, doWhile_1.doWhile)(() => (0, randint_1.randint)(2, 6), (newX) => fakeCoeffs.length === 2 &&
|
|
35
|
+
fakeCoeffs[0] === newX &&
|
|
36
|
+
fakeCoeffs[1] === newX);
|
|
37
|
+
fakeCoeffs.push(newCoeff);
|
|
38
|
+
yValues.push(x * newCoeff);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const identifiers = { xValues, yValues };
|
|
42
|
+
const question = {
|
|
43
|
+
answer: isProportionnal ? "Oui" : "Non",
|
|
44
|
+
instruction: getInstruction(identifiers),
|
|
45
|
+
keys: [],
|
|
46
|
+
answerFormat: "raw",
|
|
47
|
+
style: { tableHasNoHeader: true },
|
|
48
|
+
identifiers,
|
|
49
|
+
hint: "Pour passer de la ligne du haut à la ligne du bas, multiplie-t-on toujours par le même nombre ? Si oui, alors c'est un tableau de proportionnalité.",
|
|
50
|
+
correction: `On divise les nombres de la deuxième ligne par les nombres de la première ligne. Si on obtient toujours le même résultat, alors c'est un tableau de proportionnalité.
|
|
51
|
+
|
|
52
|
+
- $${yValues[0]}\\div ${xValues[0]} = ${yValues[0] / xValues[0]}$
|
|
53
|
+
|
|
54
|
+
- $${yValues[1]}\\div ${xValues[1]} = ${yValues[1] / xValues[1]}$
|
|
55
|
+
|
|
56
|
+
- $${yValues[2]}\\div ${xValues[2]} = ${yValues[2] / xValues[2]}$
|
|
57
|
+
|
|
58
|
+
${isProportionnal
|
|
59
|
+
? "Puisque tous les résultats sont égaux, c'est bien un tableau de proportionnalité."
|
|
60
|
+
: "Puisque les résultats ne sont pas tous égaux, ce n'est pas un tableau de proportionnalité."}
|
|
61
|
+
`,
|
|
62
|
+
};
|
|
63
|
+
return question;
|
|
64
|
+
};
|
|
65
|
+
const getPropositions = (n, { answer }) => {
|
|
66
|
+
const propositions = [];
|
|
67
|
+
(0, exercise_1.addValidProp)(propositions, answer, "raw");
|
|
68
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
|
|
69
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
|
|
70
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
|
|
71
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
72
|
+
};
|
|
73
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
74
|
+
return ans === answer;
|
|
75
|
+
};
|
|
76
|
+
exports.isTableProportional = {
|
|
77
|
+
id: "isVTableProportional",
|
|
78
|
+
label: "Reconnaître un tableau de proportionnalité",
|
|
79
|
+
levels: ["5ème"],
|
|
80
|
+
isSingleStep: true,
|
|
81
|
+
sections: ["Proportionnalité"],
|
|
82
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getIsTableProportionalQuestion, nb),
|
|
83
|
+
qcmTimer: 60,
|
|
84
|
+
freeTimer: 60,
|
|
85
|
+
getPropositions,
|
|
86
|
+
isAnswerValid,
|
|
87
|
+
answerType: "QCU",
|
|
88
|
+
subject: "Mathématiques",
|
|
89
|
+
hasHintAndCorrection: true,
|
|
90
|
+
getInstruction,
|
|
91
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAgBlC;;GAEG;AAEH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAgBlC;;GAEG;AAEH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwFF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAcvD,CAAC"}
|
|
@@ -65,7 +65,6 @@ const isAnswerValid = (ans, { a, b, c, d }) => {
|
|
|
65
65
|
// try {
|
|
66
66
|
// const parsed = equationSolutionParser(ans);
|
|
67
67
|
// if (!parsed) return false;
|
|
68
|
-
// console.log("parsed", parsed.toTex());
|
|
69
68
|
// const solution = new Rational(d - b, a - c).simplify().toTree();
|
|
70
69
|
// const solutionTex = solution.toTex();
|
|
71
70
|
// const decimal = round(solution.evaluate({}), 12).frenchify();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basicShapesNaming.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/shapes/basicShapesNaming.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"basicShapesNaming.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/shapes/basicShapesNaming.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AA8FxD,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAgBnD,CAAC"}
|
|
@@ -6,7 +6,6 @@ export * from "./reciprocalPercentage";
|
|
|
6
6
|
export * from "./percentToDecimal";
|
|
7
7
|
export * from "./valuePercent";
|
|
8
8
|
export * from "./findProportion";
|
|
9
|
-
export * from "./isTableProportional";
|
|
10
9
|
export * from "./cmToEvolution";
|
|
11
10
|
export * from "./htToTTC";
|
|
12
11
|
export * from "./ttcToHT";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC"}
|
|
@@ -22,7 +22,6 @@ __exportStar(require("./reciprocalPercentage"), exports);
|
|
|
22
22
|
__exportStar(require("./percentToDecimal"), exports);
|
|
23
23
|
__exportStar(require("./valuePercent"), exports);
|
|
24
24
|
__exportStar(require("./findProportion"), exports);
|
|
25
|
-
__exportStar(require("./isTableProportional"), exports);
|
|
26
25
|
__exportStar(require("./cmToEvolution"), exports);
|
|
27
26
|
__exportStar(require("./htToTTC"), exports);
|
|
28
27
|
__exportStar(require("./ttcToHT"), exports);
|
|
@@ -8,6 +8,9 @@ type Identifiers = {
|
|
|
8
8
|
type: string;
|
|
9
9
|
probaFrac: number[];
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type Options = {
|
|
12
|
+
allowNonIrreductible?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const probaFromTableNoContext: Exercise<Identifiers, Options>;
|
|
12
15
|
export {};
|
|
13
16
|
//# sourceMappingURL=probaFromTableNoContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probaFromTableNoContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableNoContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"probaFromTableNoContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableNoContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAgIF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAsBF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBlE,CAAC"}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.probaFromTableNoContext = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const allowNonIrreductibleFractions_1 = require("../../../exercises/options/allowNonIrreductibleFractions");
|
|
5
6
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
7
|
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
7
8
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
9
|
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
10
|
+
const rationalParser_1 = require("../../../tree/parsers/rationalParser");
|
|
9
11
|
const random_1 = require("../../../utils/alea/random");
|
|
10
12
|
const dollarize_1 = require("../../../utils/latex/dollarize");
|
|
11
13
|
const mdTable_1 = require("../../../utils/markdown/mdTable");
|
|
@@ -111,11 +113,20 @@ const getPropositions = (n, { answer, aBarreCapB, aBarreCapBBarre, aCapB, aCapBB
|
|
|
111
113
|
}
|
|
112
114
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
113
115
|
};
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
.
|
|
118
|
-
|
|
116
|
+
const options = [allowNonIrreductibleFractions_1.allowNonIrreductibleOption];
|
|
117
|
+
const isAnswerValid = (ans, { answer, probaFrac }, options) => {
|
|
118
|
+
if (options?.allowNonIrreductible) {
|
|
119
|
+
const parsed = (0, rationalParser_1.rationalParser)(ans);
|
|
120
|
+
if (!parsed)
|
|
121
|
+
return false;
|
|
122
|
+
return parsed.simplify().toTex() === answer;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
const fracTexs = new fractionNode_1.FractionNode(probaFrac[0].toTree(), probaFrac[1].toTree())
|
|
126
|
+
.simplify()
|
|
127
|
+
.toAllValidTexs();
|
|
128
|
+
return fracTexs.includes(ans);
|
|
129
|
+
}
|
|
119
130
|
};
|
|
120
131
|
exports.probaFromTableNoContext = {
|
|
121
132
|
id: "probaFromTableNoContext",
|
|
@@ -131,4 +142,5 @@ exports.probaFromTableNoContext = {
|
|
|
131
142
|
isAnswerValid,
|
|
132
143
|
subject: "Mathématiques",
|
|
133
144
|
getInstruction,
|
|
145
|
+
options,
|
|
134
146
|
};
|
|
@@ -146,7 +146,6 @@ const getPropositions = (n, { answer, rand, x1, x2, x3, x4 }) => {
|
|
|
146
146
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
147
147
|
while (propositions.length < n) {
|
|
148
148
|
const fakeRand = (0, randint_1.randint)(0, 12);
|
|
149
|
-
// console.log("marg and cond freq", answer, rand, x1, x2, x3, x4);
|
|
150
149
|
const answerTree = getAnswerNode(fakeRand, x1, x2, x3, x4);
|
|
151
150
|
(0, exercise_1.tryToAddWrongProp)(propositions, answerTree.toTex());
|
|
152
151
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -137,6 +137,9 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
137
137
|
xValues: any[];
|
|
138
138
|
yValues: any[];
|
|
139
139
|
type: number;
|
|
140
|
+
}, {}> | import("./exercises/exercise").Exercise<{
|
|
141
|
+
xValues: number[];
|
|
142
|
+
yValues: number[];
|
|
140
143
|
}, {}> | import("./exercises/exercise").Exercise<{
|
|
141
144
|
precisionAsked: number;
|
|
142
145
|
decimal: number;
|
|
@@ -1165,9 +1168,6 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
1165
1168
|
}, {}> | import("./exercises/exercise").Exercise<{
|
|
1166
1169
|
total: number;
|
|
1167
1170
|
lefties: number;
|
|
1168
|
-
}, {}> | import("./exercises/exercise").Exercise<{
|
|
1169
|
-
xValues: number[];
|
|
1170
|
-
yValues: number[];
|
|
1171
1171
|
}, {}> | import("./exercises/exercise").Exercise<{
|
|
1172
1172
|
evolution: number;
|
|
1173
1173
|
}, {}> | import("./exercises/exercise").Exercise<{
|
|
@@ -1314,7 +1314,9 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
1314
1314
|
event: string;
|
|
1315
1315
|
type: string;
|
|
1316
1316
|
probaFrac: number[];
|
|
1317
|
-
}, {
|
|
1317
|
+
}, {
|
|
1318
|
+
allowNonIrreductible?: boolean | undefined;
|
|
1319
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
1318
1320
|
aCapB: number;
|
|
1319
1321
|
aCapBBarre: number;
|
|
1320
1322
|
aBarreCapB: number;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAC;AAEjC,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sour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ASxB,MAAM,CAAC,CAAC,EAAE,MAAM;IAIhB;;;;OAIG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAIhC,oBAAoB,CAAC,KAAK,EAAE,MAAM;IAiClC,gBAAgB;IA6BhB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM;IAuCtC,cAAc,CAAC,IAAI,EAAE,MAAM;IAS3B,UAAU;IAMV,MAAM;IAIN,aAAa;IAIb,YAAY,CAAC,UAAU,EAAE,MAAM;IAS/B,YAAY,CAAC,UAAU,EAAE,MAAM;CAShC"}
|
|
@@ -101,7 +101,6 @@ class Decimal {
|
|
|
101
101
|
(isNegative ? "-" : "") +
|
|
102
102
|
intPartString.slice(0, power + intPartString.length);
|
|
103
103
|
}
|
|
104
|
-
// console.log("in", newIntPart, newFracPart);
|
|
105
104
|
return DecimalConstructor.fromParts(newIntPart, newFracPart);
|
|
106
105
|
}
|
|
107
106
|
toScientificPart() {
|
|
@@ -142,7 +141,6 @@ class Decimal {
|
|
|
142
141
|
let value = decimals === undefined
|
|
143
142
|
? this.toScientificPart()
|
|
144
143
|
: (0, round_1.round)(this.toScientificPart(), decimals);
|
|
145
|
-
// console.log(value);
|
|
146
144
|
let power = 0;
|
|
147
145
|
if (value >= 10) {
|
|
148
146
|
value = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/fractionNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAK3E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKlE,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,YAAY,CAEzD;AAED,eAAO,MAA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AAEF,qBAAa,YAAa,YAAW,YAAY;IAC/C,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,EAAE,EAAE,WAAW,CAAC;IAChB,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,aAAa,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,IAAI,CAAC,EAAE,WAAW;IAUpB,YAAY,IAAI,MAAM;IAItB,aAAa;;;;;;;;;IAQb,UAAU;IAGV,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IA+BpC,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAI5C,KAAK,IAAI,MAAM;IAsBf,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAMtC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,aAAa;IAyJ/C,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAOpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;CAMzD"}
|
|
@@ -153,7 +153,6 @@ class FractionNode {
|
|
|
153
153
|
// }
|
|
154
154
|
const simplifyExternalNodes = (num, denum) => {
|
|
155
155
|
if ((0, numberNode_1.isNumberNode)(num) && (0, numberNode_1.isNumberNode)(denum)) {
|
|
156
|
-
// console.log("num nb, denum nb", num.toTex(), denum.toTex());
|
|
157
156
|
if (denum.value < 0) {
|
|
158
157
|
if (num.value < 0) {
|
|
159
158
|
return new FractionNode(new numberNode_1.NumberNode(-num.value), new numberNode_1.NumberNode(-denum.value)).simplify();
|
|
@@ -176,7 +175,6 @@ class FractionNode {
|
|
|
176
175
|
if ((0, numberNode_1.isNumberNode)(denum) &&
|
|
177
176
|
(isFractionNode(num) ||
|
|
178
177
|
((0, oppositeNode_1.isOppositeNode)(num) && isFractionNode(num.child)))) {
|
|
179
|
-
// console.log("num frac, denum nb, ", num.toTex(), denum.toTex());
|
|
180
178
|
const trueNum = isFractionNode(num) ? num : num.child;
|
|
181
179
|
return new FractionNode(trueNum.leftChild, new multiplyNode_1.MultiplyNode(trueNum.rightChild, denum)).simplify();
|
|
182
180
|
}
|