math-exercises 3.0.82 → 3.0.83
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isNumberDecimal.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/isNumberDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"isNumberDecimal.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/isNumberDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAa7C,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE;QACP,CAAC,EAAE,eAAe,CAAC;QACnB,SAAS,EAAE,OAAO,CAAC;KACpB,EAAE,CAAC;CACL,CAAC;AAqIF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAmBjD,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { RationalConstructor } from "../../../../math/numbers/rationals/rational
|
|
|
4
4
|
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
5
5
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
6
|
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
7
|
+
import { isConstantNode } from "../../../../tree/nodes/numbers/constantNode.js";
|
|
7
8
|
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
8
9
|
import { isFractionNode, } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
9
10
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
@@ -38,7 +39,10 @@ const getCorrection = (identifiers) => {
|
|
|
38
39
|
for (const { a, isDecimal } of options) {
|
|
39
40
|
const node = reifyAlgebraic(a);
|
|
40
41
|
const tex = node.toTex();
|
|
41
|
-
if (
|
|
42
|
+
if (isConstantNode(node)) {
|
|
43
|
+
correction += `- $${tex}$ n'est pas un nombre décimal, car il s'écrit avec un nombre infini de chiffres après la virgule.\n\n`;
|
|
44
|
+
}
|
|
45
|
+
else if (isFractionNode(node)) {
|
|
42
46
|
const denom = node.rightChild.toTex();
|
|
43
47
|
if (isDecimal) {
|
|
44
48
|
correction += `- $${tex} = ${node
|