math-exercises 3.0.150 → 3.0.152

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.
Files changed (217) hide show
  1. package/lib/exercises/exercise.d.ts +5 -0
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/arithmetics/primeNumbersAffirmations.js +1 -1
  4. package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts +5 -1
  5. package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.js +92 -38
  7. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +5 -1
  9. package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/proportionality/isTableProportional.js +7 -1
  11. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.js +5 -1
  13. package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +5 -1
  15. package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.js +8 -2
  17. package/lib/exercises/math/calculLitteral/equation/equa1.d.ts +4 -1
  18. package/lib/exercises/math/calculLitteral/equation/equa1.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/equation/equa1.js +27 -7
  20. package/lib/exercises/math/calculLitteral/equation/equa2.d.ts +1 -0
  21. package/lib/exercises/math/calculLitteral/equation/equa2.d.ts.map +1 -1
  22. package/lib/exercises/math/calculLitteral/equation/equa2.js +18 -1
  23. package/lib/exercises/math/calculLitteral/equation/equa3.d.ts +4 -1
  24. package/lib/exercises/math/calculLitteral/equation/equa3.d.ts.map +1 -1
  25. package/lib/exercises/math/calculLitteral/equation/equa3.js +26 -6
  26. package/lib/exercises/math/calculLitteral/equation/equa4.d.ts +4 -1
  27. package/lib/exercises/math/calculLitteral/equation/equa4.d.ts.map +1 -1
  28. package/lib/exercises/math/calculLitteral/equation/equa4.js +27 -7
  29. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa1.d.ts +14 -0
  30. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa1.d.ts.map +1 -0
  31. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa1.js +129 -0
  32. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa2.d.ts +18 -0
  33. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa2.d.ts.map +1 -0
  34. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa2.js +167 -0
  35. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa3.d.ts +15 -0
  36. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa3.d.ts.map +1 -0
  37. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa3.js +129 -0
  38. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa4.d.ts +16 -0
  39. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa4.d.ts.map +1 -0
  40. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa4.js +124 -0
  41. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType1.d.ts +9 -0
  42. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType1.d.ts.map +1 -0
  43. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType1.js +107 -0
  44. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType2.d.ts +10 -0
  45. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType2.d.ts.map +1 -0
  46. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType2.js +108 -0
  47. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType3.d.ts +11 -0
  48. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType3.d.ts.map +1 -0
  49. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType3.js +104 -0
  50. package/lib/exercises/math/calculLitteral/equation/firstDegree/index.d.ts +8 -0
  51. package/lib/exercises/math/calculLitteral/equation/firstDegree/index.d.ts.map +1 -0
  52. package/lib/exercises/math/calculLitteral/equation/firstDegree/index.js +7 -0
  53. package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -7
  54. package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
  55. package/lib/exercises/math/calculLitteral/equation/index.js +1 -7
  56. package/lib/exercises/math/dataRepresentations/histogram/etendueHistogram.d.ts +8 -0
  57. package/lib/exercises/math/dataRepresentations/histogram/etendueHistogram.d.ts.map +1 -0
  58. package/lib/exercises/math/dataRepresentations/histogram/etendueHistogram.js +175 -0
  59. package/lib/exercises/math/dataRepresentations/histogram/histogramCommenting.d.ts +9 -0
  60. package/lib/exercises/math/dataRepresentations/histogram/histogramCommenting.d.ts.map +1 -0
  61. package/lib/exercises/math/dataRepresentations/histogram/histogramCommenting.js +250 -0
  62. package/lib/exercises/math/dataRepresentations/histogram/histogramFillDataTableFromHistogramData.d.ts +9 -0
  63. package/lib/exercises/math/dataRepresentations/histogram/histogramFillDataTableFromHistogramData.d.ts.map +1 -0
  64. package/lib/exercises/math/dataRepresentations/histogram/histogramFillDataTableFromHistogramData.js +173 -0
  65. package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.d.ts +14 -0
  66. package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.d.ts.map +1 -0
  67. package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.js +239 -0
  68. package/lib/exercises/math/dataRepresentations/histogram/histogramReading.d.ts +9 -0
  69. package/lib/exercises/math/dataRepresentations/histogram/histogramReading.d.ts.map +1 -0
  70. package/lib/exercises/math/dataRepresentations/histogram/histogramReading.js +163 -0
  71. package/lib/exercises/math/dataRepresentations/histogram/index.d.ts +6 -0
  72. package/lib/exercises/math/dataRepresentations/histogram/index.d.ts.map +1 -0
  73. package/lib/exercises/math/dataRepresentations/histogram/index.js +5 -0
  74. package/lib/exercises/math/dataRepresentations/index.d.ts +1 -1
  75. package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
  76. package/lib/exercises/math/dataRepresentations/index.js +1 -1
  77. package/lib/exercises/math/dataRepresentations/tableReading.d.ts.map +1 -1
  78. package/lib/exercises/math/dataRepresentations/tableReading.js +7 -0
  79. package/lib/exercises/math/functions/affines/affineAdjustment.d.ts.map +1 -1
  80. package/lib/exercises/math/functions/affines/affineAdjustment.js +7 -1
  81. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
  82. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +7 -1
  83. package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.d.ts.map +1 -1
  84. package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.js +7 -1
  85. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.d.ts +4 -1
  86. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.d.ts.map +1 -1
  87. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +19 -4
  88. package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts +1 -0
  89. package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts.map +1 -1
  90. package/lib/exercises/math/functions/affines/leadingCoefficient.js +13 -1
  91. package/lib/exercises/math/functions/affines/recognizeAffineGraph.d.ts +4 -1
  92. package/lib/exercises/math/functions/affines/recognizeAffineGraph.d.ts.map +1 -1
  93. package/lib/exercises/math/functions/affines/recognizeAffineGraph.js +19 -4
  94. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -1
  95. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +7 -1
  96. package/lib/exercises/math/functions/basics/placePointsFromValueTable.d.ts.map +1 -1
  97. package/lib/exercises/math/functions/basics/placePointsFromValueTable.js +7 -0
  98. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts +4 -1
  99. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
  100. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +18 -3
  101. package/lib/exercises/math/geometry/triangles/index.d.ts +1 -0
  102. package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
  103. package/lib/exercises/math/geometry/triangles/index.js +1 -0
  104. package/lib/exercises/math/geometry/triangles/similar/index.d.ts +4 -0
  105. package/lib/exercises/math/geometry/triangles/similar/index.d.ts.map +1 -0
  106. package/lib/exercises/math/geometry/triangles/similar/index.js +3 -0
  107. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.d.ts +10 -0
  108. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.d.ts.map +1 -0
  109. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.js +122 -0
  110. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWrtSideLengths.d.ts +15 -0
  111. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWrtSideLengths.d.ts.map +1 -0
  112. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWrtSideLengths.js +351 -0
  113. package/lib/exercises/math/geometry/triangles/similar/placeSegmentsOfSimilarTriangle.d.ts +11 -0
  114. package/lib/exercises/math/geometry/triangles/similar/placeSegmentsOfSimilarTriangle.d.ts.map +1 -0
  115. package/lib/exercises/math/geometry/triangles/similar/placeSegmentsOfSimilarTriangle.js +311 -0
  116. package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.d.ts +10 -0
  117. package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.d.ts.map +1 -0
  118. package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.js +135 -0
  119. package/lib/exercises/math/probaStat/basicProbas/findEffectifFromProba.d.ts +9 -0
  120. package/lib/exercises/math/probaStat/basicProbas/findEffectifFromProba.d.ts.map +1 -0
  121. package/lib/exercises/math/probaStat/basicProbas/findEffectifFromProba.js +109 -0
  122. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValue.d.ts.map +1 -1
  123. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValue.js +7 -0
  124. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.d.ts +9 -0
  125. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.d.ts.map +1 -0
  126. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.js +120 -0
  127. package/lib/exercises/math/probaStat/basicProbas/index.d.ts +4 -0
  128. package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
  129. package/lib/exercises/math/probaStat/basicProbas/index.js +4 -0
  130. package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.d.ts +12 -0
  131. package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.d.ts.map +1 -0
  132. package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.js +374 -0
  133. package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
  134. package/lib/exercises/math/probaStat/probaFromTableNoContext.js +7 -0
  135. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  136. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +7 -0
  137. package/lib/exercises/math/probaStat/stats1var/averageWithTable.d.ts.map +1 -1
  138. package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +7 -1
  139. package/lib/exercises/math/probaStat/stats1var/calculateMeanFromFrequencies.d.ts.map +1 -1
  140. package/lib/exercises/math/probaStat/stats1var/calculateMeanFromFrequencies.js +7 -0
  141. package/lib/exercises/math/probaStat/stats1var/cumulativeSum.d.ts.map +1 -1
  142. package/lib/exercises/math/probaStat/stats1var/cumulativeSum.js +7 -0
  143. package/lib/exercises/math/probaStat/stats1var/etendueTable.d.ts.map +1 -1
  144. package/lib/exercises/math/probaStat/stats1var/etendueTable.js +7 -1
  145. package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.d.ts.map +1 -1
  146. package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.js +7 -0
  147. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
  148. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +5 -1
  149. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
  150. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +7 -0
  151. package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts +2 -0
  152. package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
  153. package/lib/exercises/math/probaStat/stats1var/medianWithList.js +67 -14
  154. package/lib/exercises/math/probaStat/stats1var/medianWithTable.d.ts.map +1 -1
  155. package/lib/exercises/math/probaStat/stats1var/medianWithTable.js +7 -1
  156. package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
  157. package/lib/exercises/math/probaStat/stats1var/quartiles.js +7 -1
  158. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.d.ts.map +1 -1
  159. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +5 -1
  160. package/lib/exercises/math/probaStat/stats1var/varianceTable.d.ts.map +1 -1
  161. package/lib/exercises/math/probaStat/stats1var/varianceTable.js +5 -1
  162. package/lib/exercises/math/probaStat/stats2var/averagePoint.d.ts.map +1 -1
  163. package/lib/exercises/math/probaStat/stats2var/averagePoint.js +7 -1
  164. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts +7 -0
  165. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts.map +1 -0
  166. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.js +171 -0
  167. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.d.ts +7 -0
  168. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.d.ts.map +1 -0
  169. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.js +155 -0
  170. package/lib/exercises/math/probaStat/twoStepExperiments/index.d.ts +3 -0
  171. package/lib/exercises/math/probaStat/twoStepExperiments/index.d.ts.map +1 -1
  172. package/lib/exercises/math/probaStat/twoStepExperiments/index.js +3 -0
  173. package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.d.ts +7 -0
  174. package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.d.ts.map +1 -0
  175. package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.js +189 -0
  176. package/lib/exercises/math/spaceGeometry/index.d.ts +1 -0
  177. package/lib/exercises/math/spaceGeometry/index.d.ts.map +1 -1
  178. package/lib/exercises/math/spaceGeometry/index.js +1 -0
  179. package/lib/exercises/math/spaceGeometry/sections/areaOfConeSection.d.ts +14 -0
  180. package/lib/exercises/math/spaceGeometry/sections/areaOfConeSection.d.ts.map +1 -0
  181. package/lib/exercises/math/spaceGeometry/sections/areaOfConeSection.js +439 -0
  182. package/lib/exercises/math/spaceGeometry/sections/areaOfCylinderSection.d.ts +14 -0
  183. package/lib/exercises/math/spaceGeometry/sections/areaOfCylinderSection.d.ts.map +1 -0
  184. package/lib/exercises/math/spaceGeometry/sections/areaOfCylinderSection.js +548 -0
  185. package/lib/exercises/math/spaceGeometry/sections/areaOfRectangularPrismSection.d.ts +11 -0
  186. package/lib/exercises/math/spaceGeometry/sections/areaOfRectangularPrismSection.d.ts.map +1 -0
  187. package/lib/exercises/math/spaceGeometry/sections/areaOfRectangularPrismSection.js +360 -0
  188. package/lib/exercises/math/spaceGeometry/sections/areaOfSphereSection.d.ts +9 -0
  189. package/lib/exercises/math/spaceGeometry/sections/areaOfSphereSection.d.ts.map +1 -0
  190. package/lib/exercises/math/spaceGeometry/sections/areaOfSphereSection.js +272 -0
  191. package/lib/exercises/math/spaceGeometry/sections/index.d.ts +9 -0
  192. package/lib/exercises/math/spaceGeometry/sections/index.d.ts.map +1 -0
  193. package/lib/exercises/math/spaceGeometry/sections/index.js +8 -0
  194. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCone.d.ts +11 -0
  195. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCone.d.ts.map +1 -0
  196. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCone.js +266 -0
  197. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCylinder.d.ts +11 -0
  198. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCylinder.d.ts.map +1 -0
  199. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCylinder.js +236 -0
  200. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfRectangularPrism.d.ts +7 -0
  201. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfRectangularPrism.d.ts.map +1 -0
  202. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfRectangularPrism.js +92 -0
  203. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfSphereOrBall.d.ts +9 -0
  204. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfSphereOrBall.d.ts.map +1 -0
  205. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfSphereOrBall.js +236 -0
  206. package/lib/exercises/pc/mathExosInPC.d.ts +4 -4
  207. package/lib/exercises/pc/mathExosInPC.d.ts.map +1 -1
  208. package/lib/exercises/pc/mathExosInPC.js +4 -4
  209. package/lib/index.d.ts +173 -45
  210. package/lib/index.d.ts.map +1 -1
  211. package/lib/math/geometry/spacePoint.d.ts +10 -0
  212. package/lib/math/geometry/spacePoint.d.ts.map +1 -1
  213. package/lib/math/geometry/spacePoint.js +13 -0
  214. package/lib/tree/nodes/operators/substractNode.d.ts +1 -0
  215. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  216. package/lib/tree/nodes/operators/substractNode.js +6 -0
  217. package/package.json +1 -1
@@ -1,6 +1,10 @@
1
1
  import { NumberNode } from "../../tree/nodes/numbers/numberNode.js";
2
2
  import { randint } from "../utils/random/randint.js";
3
+ import { NodeConstructor, } from "../../tree/nodes/nodeConstructor.js";
3
4
  export class SpacePointConstructor {
5
+ static fromIdentifiers(identifiers) {
6
+ return new SpacePoint(identifiers.name, NodeConstructor.fromIdentifiers(identifiers.x), NodeConstructor.fromIdentifiers(identifiers.y), NodeConstructor.fromIdentifiers(identifiers.z));
7
+ }
4
8
  static random(name, xOpts, yOpts, zOpts) {
5
9
  const x = randint(xOpts?.min ?? -9, xOpts?.max ?? 10, xOpts?.excludes ?? []);
6
10
  const y = randint(yOpts?.min ?? -9, yOpts?.max ?? 10, yOpts?.excludes ?? []);
@@ -46,6 +50,15 @@ export class SpacePoint {
46
50
  this.y = y;
47
51
  this.z = z;
48
52
  }
53
+ toIdentifiers() {
54
+ return {
55
+ id: "spacePoint",
56
+ name: this.name,
57
+ x: this.x.toIdentifiers(),
58
+ y: this.y.toIdentifiers(),
59
+ z: this.z.toIdentifiers(),
60
+ };
61
+ }
49
62
  getCoords() {
50
63
  return [this.x, this.y, this.z];
51
64
  }
@@ -26,6 +26,7 @@ export declare class SubstractNode implements OperatorNode {
26
26
  toAllValidTexs(): string[];
27
27
  dangerouslyShuffle(): void;
28
28
  toTex(options?: ToTexOptions): string;
29
+ toSimplificationTex(opts?: SimplifyOptions): string;
29
30
  evaluate(vars?: Record<string, number>): number;
30
31
  simplify(opts?: SimplifyOptions): AlgebraicNode;
31
32
  equals(node: AlgebraicNode): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"substractNode.d.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C,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAMtC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe;IAM/B,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAOpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAMxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;IAMvD,OAAO,uBAGL;CACH"}
@@ -72,6 +72,12 @@ export class SubstractNode {
72
72
  rightTex = `\\left(${rightTex}\\right)`;
73
73
  return colorize(`${leftTex}-${rightTex}`, color);
74
74
  }
75
+ toSimplificationTex(opts) {
76
+ const simp = this.simplify(opts);
77
+ if (simp.toTex() !== this.toTex())
78
+ return this.toTex() + "=" + simp.toTex();
79
+ return this.toTex();
80
+ }
75
81
  evaluate(vars) {
76
82
  return this.leftChild.evaluate(vars) - this.rightChild.evaluate(vars);
77
83
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-exercises",
3
3
  "type": "module",
4
- "version": "3.0.150",
4
+ "version": "3.0.152",
5
5
  "description": "Math exercises generator for middle school and high school",
6
6
  "main": "lib/index.js",
7
7
  "files": [