math-exercises 2.0.1 → 2.0.2
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/addAndSub.d.ts +4 -5
- package/lib/exercises/calcul/addAndSub.d.ts.map +1 -1
- package/lib/exercises/calcul/addAndSub.js +14 -8
- package/lib/exercises/calcul/addAndSubWithoutRelatives.d.ts +4 -5
- package/lib/exercises/calcul/addAndSubWithoutRelatives.d.ts.map +1 -1
- package/lib/exercises/calcul/addAndSubWithoutRelatives.js +15 -8
- package/lib/exercises/calcul/arithmetics/euclideanDivision.d.ts +3 -7
- package/lib/exercises/calcul/arithmetics/euclideanDivision.d.ts.map +1 -1
- package/lib/exercises/calcul/arithmetics/euclideanDivision.js +10 -11
- package/lib/exercises/calcul/arithmetics/index.d.ts +4 -0
- package/lib/exercises/calcul/arithmetics/index.d.ts.map +1 -0
- package/lib/exercises/calcul/arithmetics/index.js +19 -0
- package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.d.ts +3 -5
- package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.d.ts.map +1 -1
- package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.js +44 -42
- package/lib/exercises/calcul/arithmetics/primeNumbers.d.ts +3 -7
- package/lib/exercises/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
- package/lib/exercises/calcul/arithmetics/primeNumbers.js +18 -17
- package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.d.ts +3 -9
- package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.js +17 -13
- package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.d.ts +3 -8
- package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.js +16 -9
- package/lib/exercises/calcul/fractions/fractionAndIntegerSum.d.ts +3 -8
- package/lib/exercises/calcul/fractions/fractionAndIntegerSum.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionAndIntegerSum.js +12 -7
- package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.d.ts +3 -5
- package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.js +75 -29
- package/lib/exercises/calcul/fractions/fractionsDivision.d.ts +3 -5
- package/lib/exercises/calcul/fractions/fractionsDivision.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionsDivision.js +17 -8
- package/lib/exercises/calcul/fractions/fractionsProduct.d.ts +3 -5
- package/lib/exercises/calcul/fractions/fractionsProduct.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionsProduct.js +17 -8
- package/lib/exercises/calcul/fractions/fractionsSum.d.ts +3 -5
- package/lib/exercises/calcul/fractions/fractionsSum.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionsSum.js +17 -8
- package/lib/exercises/calcul/fractions/index.d.ts +9 -0
- package/lib/exercises/calcul/fractions/index.d.ts.map +1 -0
- package/lib/exercises/calcul/fractions/index.js +24 -0
- package/lib/exercises/calcul/fractions/simplifyFraction.d.ts +5 -5
- package/lib/exercises/calcul/fractions/simplifyFraction.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/simplifyFraction.js +17 -7
- package/lib/exercises/calcul/index.d.ts +9 -0
- package/lib/exercises/calcul/index.d.ts.map +1 -0
- package/lib/exercises/calcul/index.js +24 -0
- package/lib/exercises/calcul/mentalCaluls/index.d.ts +5 -0
- package/lib/exercises/calcul/mentalCaluls/index.d.ts.map +1 -0
- package/lib/exercises/calcul/mentalCaluls/index.js +20 -0
- package/lib/exercises/calcul/mentalCaluls/mentalAddAndSub.d.ts +7 -0
- package/lib/exercises/calcul/mentalCaluls/mentalAddAndSub.d.ts.map +1 -0
- package/lib/exercises/calcul/mentalCaluls/mentalAddAndSub.js +84 -0
- package/lib/exercises/calcul/mentalCaluls/mentalDivisions.d.ts +10 -0
- package/lib/exercises/calcul/mentalCaluls/mentalDivisions.d.ts.map +1 -0
- package/lib/exercises/calcul/mentalCaluls/mentalDivisions.js +101 -0
- package/lib/exercises/calcul/mentalCaluls/mentalMultiplications.d.ts +7 -0
- package/lib/exercises/calcul/mentalCaluls/mentalMultiplications.d.ts.map +1 -0
- package/lib/exercises/calcul/mentalCaluls/mentalMultiplications.js +84 -0
- package/lib/exercises/calcul/mentalCaluls/mentalPercentage.d.ts +9 -0
- package/lib/exercises/calcul/mentalCaluls/mentalPercentage.d.ts.map +1 -0
- package/lib/exercises/calcul/mentalCaluls/mentalPercentage.js +140 -0
- package/lib/exercises/calcul/operations/index.d.ts +3 -0
- package/lib/exercises/calcul/operations/index.d.ts.map +1 -0
- package/lib/exercises/calcul/operations/index.js +18 -0
- package/lib/exercises/calcul/operations/operationsPriorities.d.ts +8 -5
- package/lib/exercises/calcul/operations/operationsPriorities.d.ts.map +1 -1
- package/lib/exercises/calcul/operations/operationsPriorities.js +18 -10
- package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.d.ts +9 -5
- package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
- package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.js +19 -11
- package/lib/exercises/calcul/proportionality/index.d.ts +2 -0
- package/lib/exercises/calcul/proportionality/index.d.ts.map +1 -0
- package/lib/exercises/calcul/proportionality/index.js +17 -0
- package/lib/exercises/calcul/proportionality/proportionalityTable.d.ts +8 -5
- package/lib/exercises/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/calcul/proportionality/proportionalityTable.js +21 -17
- package/lib/exercises/calcul/rounding/index.d.ts +2 -0
- package/lib/exercises/calcul/rounding/index.d.ts.map +1 -0
- package/lib/exercises/calcul/rounding/index.js +17 -0
- package/lib/exercises/calcul/rounding/rounding.d.ts +7 -9
- package/lib/exercises/calcul/rounding/rounding.d.ts.map +1 -1
- package/lib/exercises/calcul/rounding/rounding.js +52 -32
- package/lib/exercises/calculLitteral/distributivity/allIdentities.d.ts +3 -5
- package/lib/exercises/calculLitteral/distributivity/allIdentities.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/allIdentities.js +31 -11
- package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.d.ts +3 -5
- package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.js +26 -10
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.d.ts +6 -7
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.js +18 -10
- package/lib/exercises/calculLitteral/distributivity/index.d.ts +7 -0
- package/lib/exercises/calculLitteral/distributivity/index.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/distributivity/index.js +26 -0
- package/lib/exercises/calculLitteral/distributivity/secondIdentity.d.ts +6 -7
- package/lib/exercises/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/secondIdentity.js +19 -11
- package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.d.ts +3 -5
- package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.js +16 -9
- package/lib/exercises/calculLitteral/distributivity/thirdIdentity.d.ts +6 -7
- package/lib/exercises/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/thirdIdentity.js +22 -10
- package/lib/exercises/calculLitteral/equation/equationSimpleSquare.d.ts +2 -5
- package/lib/exercises/calculLitteral/equation/equationSimpleSquare.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationSimpleSquare.js +72 -26
- package/lib/exercises/calculLitteral/equation/equationType1Exercise.d.ts +3 -5
- package/lib/exercises/calculLitteral/equation/equationType1Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType1Exercise.js +19 -9
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.d.ts +3 -5
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.js +25 -12
- package/lib/exercises/calculLitteral/equation/equationType3Exercise.d.ts +3 -5
- package/lib/exercises/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType3Exercise.js +25 -13
- package/lib/exercises/calculLitteral/equation/equationType4Exercise.d.ts +3 -5
- package/lib/exercises/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType4Exercise.js +32 -15
- package/lib/exercises/calculLitteral/equation/expEquation.d.ts +5 -5
- package/lib/exercises/calculLitteral/equation/expEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/expEquation.js +38 -14
- package/lib/exercises/calculLitteral/equation/firstDegreeEquation.d.ts +3 -5
- package/lib/exercises/calculLitteral/equation/firstDegreeEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/firstDegreeEquation.js +25 -12
- package/lib/exercises/calculLitteral/equation/fractionEquation.d.ts +7 -5
- package/lib/exercises/calculLitteral/equation/fractionEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/fractionEquation.js +42 -18
- package/lib/exercises/calculLitteral/equation/index.d.ts +11 -0
- package/lib/exercises/calculLitteral/equation/index.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/equation/index.js +26 -0
- package/lib/exercises/calculLitteral/equation/logEquation.d.ts +5 -5
- package/lib/exercises/calculLitteral/equation/logEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/logEquation.js +36 -14
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.d.ts +7 -5
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.js +30 -17
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.d.ts +3 -5
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.js +16 -9
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.d.ts +3 -5
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.js +17 -10
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts +3 -5
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.js +20 -9
- package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.d.ts +3 -5
- package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.js +48 -15
- package/lib/exercises/calculLitteral/factorisation/index.d.ts +5 -0
- package/lib/exercises/calculLitteral/factorisation/index.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/factorisation/index.js +20 -0
- package/lib/exercises/calculLitteral/index.d.ts +6 -0
- package/lib/exercises/calculLitteral/index.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/index.js +21 -0
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.d.ts +5 -7
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.js +32 -12
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.d.ts +4 -6
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.js +42 -12
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.d.ts +5 -6
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.js +46 -13
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.d.ts +7 -6
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.js +54 -13
- package/lib/exercises/calculLitteral/inequations/index.d.ts +5 -0
- package/lib/exercises/calculLitteral/inequations/index.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/inequations/index.js +20 -0
- package/lib/exercises/calculLitteral/simplifying/evaluateExpression.d.ts +7 -5
- package/lib/exercises/calculLitteral/simplifying/evaluateExpression.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/simplifying/evaluateExpression.js +28 -13
- package/lib/exercises/calculLitteral/simplifying/expSimplifiying.d.ts +6 -5
- package/lib/exercises/calculLitteral/simplifying/expSimplifiying.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/simplifying/expSimplifiying.js +71 -36
- package/lib/exercises/calculLitteral/simplifying/index.d.ts +5 -0
- package/lib/exercises/calculLitteral/simplifying/index.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/simplifying/index.js +20 -0
- package/lib/exercises/calculLitteral/simplifying/logSimplifiying.d.ts +5 -5
- package/lib/exercises/calculLitteral/simplifying/logSimplifiying.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/simplifying/logSimplifiying.js +35 -19
- package/lib/exercises/calculLitteral/simplifying/reduceExpression.d.ts +4 -5
- package/lib/exercises/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/simplifying/reduceExpression.js +50 -43
- package/lib/exercises/combinatory/anagrams.d.ts +3 -5
- package/lib/exercises/combinatory/anagrams.d.ts.map +1 -1
- package/lib/exercises/combinatory/anagrams.js +108 -104
- package/lib/exercises/combinatory/ballsCounting.d.ts +3 -5
- package/lib/exercises/combinatory/ballsCounting.d.ts.map +1 -1
- package/lib/exercises/combinatory/ballsCounting.js +38 -31
- package/lib/exercises/combinatory/diceCounting.d.ts +3 -5
- package/lib/exercises/combinatory/diceCounting.d.ts.map +1 -1
- package/lib/exercises/combinatory/diceCounting.js +43 -39
- package/lib/exercises/combinatory/index.d.ts +4 -0
- package/lib/exercises/combinatory/index.d.ts.map +1 -0
- package/lib/exercises/combinatory/index.js +19 -0
- package/lib/exercises/complex/addComplex.d.ts +3 -5
- package/lib/exercises/complex/addComplex.d.ts.map +1 -1
- package/lib/exercises/complex/addComplex.js +27 -14
- package/lib/exercises/complex/argumentFromAlgebraicComplex.d.ts +0 -9
- package/lib/exercises/complex/argumentFromAlgebraicComplex.d.ts.map +1 -1
- package/lib/exercises/complex/argumentFromAlgebraicComplex.js +51 -36
- package/lib/exercises/complex/conjugateComplex.ts.d.ts +3 -5
- package/lib/exercises/complex/conjugateComplex.ts.d.ts.map +1 -1
- package/lib/exercises/complex/conjugateComplex.ts.js +16 -8
- package/lib/exercises/complex/conjugateDivideComplex.d.ts +5 -5
- package/lib/exercises/complex/conjugateDivideComplex.d.ts.map +1 -1
- package/lib/exercises/complex/conjugateDivideComplex.js +19 -7
- package/lib/exercises/complex/conjugateMultiplyComplex.d.ts +3 -5
- package/lib/exercises/complex/conjugateMultiplyComplex.d.ts.map +1 -1
- package/lib/exercises/complex/conjugateMultiplyComplex.js +18 -8
- package/lib/exercises/complex/divideComplex.d.ts +5 -5
- package/lib/exercises/complex/divideComplex.d.ts.map +1 -1
- package/lib/exercises/complex/divideComplex.js +22 -9
- package/lib/exercises/complex/index.d.ts +11 -0
- package/lib/exercises/complex/index.d.ts.map +1 -0
- package/lib/exercises/complex/index.js +27 -0
- package/lib/exercises/complex/inverseComplex.d.ts +3 -5
- package/lib/exercises/complex/inverseComplex.d.ts.map +1 -1
- package/lib/exercises/complex/inverseComplex.js +16 -8
- package/lib/exercises/complex/linearCombinaisonComplex.d.ts +7 -5
- package/lib/exercises/complex/linearCombinaisonComplex.d.ts.map +1 -1
- package/lib/exercises/complex/linearCombinaisonComplex.js +21 -13
- package/lib/exercises/complex/moduloFromAlgebraicComplex.d.ts +2 -4
- package/lib/exercises/complex/moduloFromAlgebraicComplex.d.ts.map +1 -1
- package/lib/exercises/complex/moduloFromAlgebraicComplex.js +13 -1
- package/lib/exercises/complex/mutiplyComplex.d.ts +3 -5
- package/lib/exercises/complex/mutiplyComplex.d.ts.map +1 -1
- package/lib/exercises/complex/mutiplyComplex.js +20 -9
- package/lib/exercises/complex/reAndIm.d.ts +3 -5
- package/lib/exercises/complex/reAndIm.d.ts.map +1 -1
- package/lib/exercises/complex/reAndIm.js +16 -12
- package/lib/exercises/conversion/aeraConversion.d.ts +3 -5
- package/lib/exercises/conversion/aeraConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/aeraConversion.js +24 -11
- package/lib/exercises/conversion/capacityConversion.d.ts +3 -5
- package/lib/exercises/conversion/capacityConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/capacityConversion.js +24 -11
- package/lib/exercises/conversion/index.d.ts +7 -0
- package/lib/exercises/conversion/index.d.ts.map +1 -0
- package/lib/exercises/conversion/index.js +22 -0
- package/lib/exercises/conversion/lengthConversion.d.ts +3 -5
- package/lib/exercises/conversion/lengthConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/lengthConversion.js +24 -11
- package/lib/exercises/conversion/massConversion.d.ts +3 -5
- package/lib/exercises/conversion/massConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/massConversion.js +24 -11
- package/lib/exercises/conversion/volumeCapacityConversion.d.ts +7 -5
- package/lib/exercises/conversion/volumeCapacityConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/volumeCapacityConversion.js +28 -16
- package/lib/exercises/conversion/volumeConversion.d.ts +3 -5
- package/lib/exercises/conversion/volumeConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/volumeConversion.js +25 -12
- package/lib/exercises/derivation/derivative/constanteDerivative.d.ts +6 -7
- package/lib/exercises/derivation/derivative/constanteDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/constanteDerivative.js +18 -13
- package/lib/exercises/derivation/derivative/expDerivativeOne.d.ts +3 -5
- package/lib/exercises/derivation/derivative/expDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/expDerivativeOne.js +20 -13
- package/lib/exercises/derivation/derivative/expDerivativeThree.d.ts +3 -5
- package/lib/exercises/derivation/derivative/expDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/expDerivativeThree.js +21 -15
- package/lib/exercises/derivation/derivative/expDerivativeTwo.d.ts +3 -5
- package/lib/exercises/derivation/derivative/expDerivativeTwo.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/expDerivativeTwo.js +19 -14
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.d.ts +6 -7
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.js +18 -13
- package/lib/exercises/derivation/derivative/index.d.ts +18 -0
- package/lib/exercises/derivation/derivative/index.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/index.js +38 -0
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.d.ts +3 -5
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.js +19 -8
- package/lib/exercises/derivation/derivative/lnDerivativeOne.d.ts +3 -5
- package/lib/exercises/derivation/derivative/lnDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/lnDerivativeOne.js +27 -14
- package/lib/exercises/derivation/derivative/lnDerivativeThree.d.ts +3 -5
- package/lib/exercises/derivation/derivative/lnDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/lnDerivativeThree.js +37 -15
- package/lib/exercises/derivation/derivative/lnDerivativeTwo.d.ts +3 -5
- package/lib/exercises/derivation/derivative/lnDerivativeTwo.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/lnDerivativeTwo.js +21 -16
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.d.ts +3 -5
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.js +34 -14
- package/lib/exercises/derivation/derivative/productDerivative.d.ts +3 -5
- package/lib/exercises/derivation/derivative/productDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/productDerivative.js +21 -7
- package/lib/exercises/derivation/derivative/quotientDerivative.d.ts +3 -6
- package/lib/exercises/derivation/derivative/quotientDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/quotientDerivative.js +50 -14
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.d.ts +3 -5
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.js +26 -10
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.d.ts +6 -7
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.js +28 -9
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.d.ts +6 -7
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.js +35 -10
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts +5 -5
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.js +45 -12
- package/lib/exercises/derivation/derivative/usualderivative.d.ts +3 -5
- package/lib/exercises/derivation/derivative/usualderivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/usualderivative.js +56 -15
- package/lib/exercises/derivation/derivativeNumberCalcul.d.ts +5 -5
- package/lib/exercises/derivation/derivativeNumberCalcul.d.ts.map +1 -1
- package/lib/exercises/derivation/derivativeNumberCalcul.js +16 -10
- package/lib/exercises/derivation/derivativeNumberReading.d.ts +3 -5
- package/lib/exercises/derivation/derivativeNumberReading.d.ts.map +1 -1
- package/lib/exercises/derivation/derivativeNumberReading.js +43 -33
- package/lib/exercises/derivation/index.d.ts +4 -0
- package/lib/exercises/derivation/index.d.ts.map +1 -0
- package/lib/exercises/derivation/index.js +19 -0
- package/lib/exercises/equaDiff/equaDiffGeneralForme.d.ts +4 -5
- package/lib/exercises/equaDiff/equaDiffGeneralForme.d.ts.map +1 -1
- package/lib/exercises/equaDiff/equaDiffGeneralForme.js +23 -16
- package/lib/exercises/equaDiff/equaDiffGeneralFormeWithIC.d.ts +5 -5
- package/lib/exercises/equaDiff/equaDiffGeneralFormeWithIC.d.ts.map +1 -1
- package/lib/exercises/equaDiff/equaDiffGeneralFormeWithIC.js +31 -28
- package/lib/exercises/equaDiff/index.d.ts +3 -0
- package/lib/exercises/equaDiff/index.d.ts.map +1 -0
- package/lib/exercises/equaDiff/index.js +18 -0
- package/lib/exercises/exercise.d.ts +26 -21
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercise.js +3 -3
- package/lib/exercises/functions/absolute/absoluteValueEquations.d.ts +3 -5
- package/lib/exercises/functions/absolute/absoluteValueEquations.d.ts.map +1 -1
- package/lib/exercises/functions/absolute/absoluteValueEquations.js +27 -9
- package/lib/exercises/functions/absolute/absoluteValueInequations.d.ts +4 -5
- package/lib/exercises/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
- package/lib/exercises/functions/absolute/absoluteValueInequations.js +31 -9
- package/lib/exercises/functions/absolute/index.d.ts +3 -0
- package/lib/exercises/functions/absolute/index.d.ts.map +1 -0
- package/lib/exercises/functions/absolute/index.js +18 -0
- package/lib/exercises/functions/affines/index.d.ts +5 -0
- package/lib/exercises/functions/affines/index.d.ts.map +1 -0
- package/lib/exercises/functions/affines/index.js +20 -0
- package/lib/exercises/functions/affines/leadingCoefficient.d.ts +3 -5
- package/lib/exercises/functions/affines/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/functions/affines/leadingCoefficient.js +34 -35
- package/lib/exercises/functions/affines/leadingCoefficientCalculV1.d.ts +3 -5
- package/lib/exercises/functions/affines/leadingCoefficientCalculV1.d.ts.map +1 -1
- package/lib/exercises/functions/affines/leadingCoefficientCalculV1.js +19 -11
- package/lib/exercises/functions/affines/leadingCoefficientCalculV2.d.ts +3 -5
- package/lib/exercises/functions/affines/leadingCoefficientCalculV2.d.ts.map +1 -1
- package/lib/exercises/functions/affines/leadingCoefficientCalculV2.js +18 -10
- package/lib/exercises/functions/affines/signFunction.d.ts +6 -5
- package/lib/exercises/functions/affines/signFunction.d.ts.map +1 -1
- package/lib/exercises/functions/affines/signFunction.js +44 -29
- package/lib/exercises/functions/basics/imageFunction.d.ts +7 -5
- package/lib/exercises/functions/basics/imageFunction.d.ts.map +1 -1
- package/lib/exercises/functions/basics/imageFunction.js +24 -9
- package/lib/exercises/functions/basics/imageFunctionGeogebra.d.ts +7 -5
- package/lib/exercises/functions/basics/imageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/functions/basics/imageFunctionGeogebra.js +29 -12
- package/lib/exercises/functions/basics/index.d.ts +5 -0
- package/lib/exercises/functions/basics/index.d.ts.map +1 -0
- package/lib/exercises/functions/basics/index.js +20 -0
- package/lib/exercises/functions/basics/inverseImageFunction.d.ts +5 -5
- package/lib/exercises/functions/basics/inverseImageFunction.d.ts.map +1 -1
- package/lib/exercises/functions/basics/inverseImageFunction.js +18 -14
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.d.ts +3 -5
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.js +34 -13
- package/lib/exercises/functions/cube/cubicEquation.d.ts +3 -5
- package/lib/exercises/functions/cube/cubicEquation.d.ts.map +1 -1
- package/lib/exercises/functions/cube/cubicEquation.js +21 -9
- package/lib/exercises/functions/cube/index.d.ts +2 -0
- package/lib/exercises/functions/cube/index.d.ts.map +1 -0
- package/lib/exercises/functions/cube/index.js +17 -0
- package/lib/exercises/functions/index.d.ts +7 -0
- package/lib/exercises/functions/index.d.ts.map +1 -0
- package/lib/exercises/functions/index.js +22 -0
- package/lib/exercises/functions/rationalFraction/index.d.ts +2 -0
- package/lib/exercises/functions/rationalFraction/index.d.ts.map +1 -0
- package/lib/exercises/functions/rationalFraction/index.js +17 -0
- package/lib/exercises/functions/rationalFraction/rationalFractionForbiddenValue.d.ts +2 -4
- package/lib/exercises/functions/rationalFraction/rationalFractionForbiddenValue.d.ts.map +1 -1
- package/lib/exercises/functions/rationalFraction/rationalFractionForbiddenValue.js +10 -2
- package/lib/exercises/functions/trinoms/alphaBetaFromDevForm.d.ts +5 -5
- package/lib/exercises/functions/trinoms/alphaBetaFromDevForm.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/alphaBetaFromDevForm.js +17 -11
- package/lib/exercises/functions/trinoms/alphaBetaInCanonicalForm.d.ts +3 -5
- package/lib/exercises/functions/trinoms/alphaBetaInCanonicalForm.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/alphaBetaInCanonicalForm.js +22 -14
- package/lib/exercises/functions/trinoms/canonicalFromDevForm.d.ts +5 -5
- package/lib/exercises/functions/trinoms/canonicalFromDevForm.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/canonicalFromDevForm.js +18 -9
- package/lib/exercises/functions/trinoms/deltaTrinom.d.ts +3 -5
- package/lib/exercises/functions/trinoms/deltaTrinom.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/deltaTrinom.js +18 -11
- package/lib/exercises/functions/trinoms/extremumFromCanonicalForm.d.ts +3 -5
- package/lib/exercises/functions/trinoms/extremumFromCanonicalForm.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/extremumFromCanonicalForm.js +21 -12
- package/lib/exercises/functions/trinoms/extremumTypeFromAlgebricForm.d.ts +5 -5
- package/lib/exercises/functions/trinoms/extremumTypeFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/extremumTypeFromAlgebricForm.js +14 -12
- package/lib/exercises/functions/trinoms/index.d.ts +11 -0
- package/lib/exercises/functions/trinoms/index.d.ts.map +1 -0
- package/lib/exercises/functions/trinoms/index.js +26 -0
- package/lib/exercises/functions/trinoms/niceRootsFromDevForm.d.ts +6 -5
- package/lib/exercises/functions/trinoms/niceRootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/niceRootsFromDevForm.js +22 -10
- package/lib/exercises/functions/trinoms/rootsFromDevForm.d.ts +6 -5
- package/lib/exercises/functions/trinoms/rootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/rootsFromDevForm.js +22 -10
- package/lib/exercises/functions/trinoms/rootsFromFactorizedForm.d.ts +3 -5
- package/lib/exercises/functions/trinoms/rootsFromFactorizedForm.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/rootsFromFactorizedForm.js +26 -13
- package/lib/exercises/functions/trinoms/variationsFromAlgebricForm.d.ts +5 -5
- package/lib/exercises/functions/trinoms/variationsFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/variationsFromAlgebricForm.js +16 -12
- package/lib/exercises/geometry/areas/circleArea.d.ts +9 -0
- package/lib/exercises/geometry/areas/circleArea.d.ts.map +1 -0
- package/lib/exercises/geometry/areas/circleArea.js +52 -0
- package/lib/exercises/geometry/areas/index.d.ts +7 -0
- package/lib/exercises/geometry/areas/index.d.ts.map +1 -0
- package/lib/exercises/geometry/areas/index.js +22 -0
- package/lib/exercises/geometry/areas/rectangleArea.d.ts +8 -0
- package/lib/exercises/geometry/areas/rectangleArea.d.ts.map +1 -0
- package/lib/exercises/geometry/areas/rectangleArea.js +46 -0
- package/lib/exercises/geometry/areas/rightTriangleArea.d.ts +7 -0
- package/lib/exercises/geometry/areas/rightTriangleArea.d.ts.map +1 -0
- package/lib/exercises/geometry/areas/rightTriangleArea.js +75 -0
- package/lib/exercises/geometry/areas/squareArea.d.ts +7 -0
- package/lib/exercises/geometry/areas/squareArea.d.ts.map +1 -0
- package/lib/exercises/geometry/areas/squareArea.js +46 -0
- package/lib/exercises/geometry/areas/triangleArea.d.ts +5 -0
- package/lib/exercises/geometry/areas/triangleArea.d.ts.map +1 -0
- package/lib/exercises/geometry/areas/triangleArea.js +97 -0
- package/lib/exercises/geometry/areas/triangleAreaV2.d.ts +7 -0
- package/lib/exercises/geometry/areas/triangleAreaV2.d.ts.map +1 -0
- package/lib/exercises/geometry/areas/triangleAreaV2.js +71 -0
- package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.d.ts +3 -5
- package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.d.ts.map +1 -1
- package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.js +54 -24
- package/lib/exercises/geometry/cartesian/index.d.ts +3 -0
- package/lib/exercises/geometry/cartesian/index.d.ts.map +1 -0
- package/lib/exercises/geometry/cartesian/index.js +18 -0
- package/lib/exercises/geometry/cartesian/midpoint.d.ts +5 -5
- package/lib/exercises/geometry/cartesian/midpoint.d.ts.map +1 -1
- package/lib/exercises/geometry/cartesian/midpoint.js +29 -14
- package/lib/exercises/geometry/index.d.ts +7 -0
- package/lib/exercises/geometry/index.d.ts.map +1 -0
- package/lib/exercises/geometry/index.js +22 -0
- package/lib/exercises/geometry/perimeters/circleCircumference.d.ts +9 -0
- package/lib/exercises/geometry/perimeters/circleCircumference.d.ts.map +1 -0
- package/lib/exercises/geometry/perimeters/circleCircumference.js +52 -0
- package/lib/exercises/geometry/perimeters/index.d.ts +5 -0
- package/lib/exercises/geometry/perimeters/index.d.ts.map +1 -0
- package/lib/exercises/geometry/perimeters/index.js +20 -0
- package/lib/exercises/geometry/perimeters/rectanglePerimeter.d.ts +8 -0
- package/lib/exercises/geometry/perimeters/rectanglePerimeter.d.ts.map +1 -0
- package/lib/exercises/geometry/perimeters/rectanglePerimeter.js +46 -0
- package/lib/exercises/geometry/perimeters/squarePerimeter.d.ts +7 -0
- package/lib/exercises/geometry/perimeters/squarePerimeter.d.ts.map +1 -0
- package/lib/exercises/geometry/perimeters/squarePerimeter.js +46 -0
- package/lib/exercises/geometry/perimeters/trianglePerimeter.d.ts +7 -0
- package/lib/exercises/geometry/perimeters/trianglePerimeter.d.ts.map +1 -0
- package/lib/exercises/geometry/perimeters/trianglePerimeter.js +46 -0
- package/lib/exercises/geometry/pythagore/index.d.ts +3 -0
- package/lib/exercises/geometry/pythagore/index.d.ts.map +1 -0
- package/lib/exercises/geometry/pythagore/index.js +18 -0
- package/lib/exercises/geometry/pythagore/pythagore.d.ts +9 -0
- package/lib/exercises/geometry/pythagore/pythagore.d.ts.map +1 -0
- package/lib/exercises/geometry/pythagore/pythagore.js +65 -0
- package/lib/exercises/geometry/pythagore/pythagoreCalcul.d.ts +8 -0
- package/lib/exercises/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -0
- package/lib/exercises/geometry/pythagore/pythagoreCalcul.js +102 -0
- package/lib/exercises/geometry/thales/index.d.ts +3 -0
- package/lib/exercises/geometry/thales/index.d.ts.map +1 -0
- package/lib/exercises/geometry/thales/index.js +18 -0
- package/lib/exercises/geometry/thales/thales.d.ts +7 -0
- package/lib/exercises/geometry/thales/thales.d.ts.map +1 -0
- package/lib/exercises/geometry/thales/thales.js +130 -0
- package/lib/exercises/geometry/thales/thalesCalcul.d.ts +10 -0
- package/lib/exercises/geometry/thales/thalesCalcul.d.ts.map +1 -0
- package/lib/exercises/geometry/thales/thalesCalcul.js +145 -0
- package/lib/exercises/geometry/vectors/chasles.d.ts +4 -5
- package/lib/exercises/geometry/vectors/chasles.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/chasles.js +23 -16
- package/lib/exercises/geometry/vectors/coordinatesReading.d.ts +3 -5
- package/lib/exercises/geometry/vectors/coordinatesReading.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/coordinatesReading.js +12 -8
- package/lib/exercises/geometry/vectors/determinant.d.ts +3 -5
- package/lib/exercises/geometry/vectors/determinant.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/determinant.js +19 -12
- package/lib/exercises/geometry/vectors/index.d.ts +6 -0
- package/lib/exercises/geometry/vectors/index.d.ts.map +1 -0
- package/lib/exercises/geometry/vectors/index.js +21 -0
- package/lib/exercises/geometry/vectors/scalarProductViaCoords.d.ts +5 -5
- package/lib/exercises/geometry/vectors/scalarProductViaCoords.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/scalarProductViaCoords.js +16 -9
- package/lib/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts +3 -5
- package/lib/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.js +12 -8
- package/lib/exercises/index.d.ts +19 -0
- package/lib/exercises/index.d.ts.map +1 -0
- package/lib/exercises/index.js +34 -0
- package/lib/exercises/limits/index.d.ts +10 -0
- package/lib/exercises/limits/index.d.ts.map +1 -0
- package/lib/exercises/limits/index.js +25 -0
- package/lib/exercises/limits/polynomLimit.d.ts +4 -5
- package/lib/exercises/limits/polynomLimit.d.ts.map +1 -1
- package/lib/exercises/limits/polynomLimit.js +20 -14
- package/lib/exercises/limits/polynomLimitNoFI.d.ts +4 -5
- package/lib/exercises/limits/polynomLimitNoFI.d.ts.map +1 -1
- package/lib/exercises/limits/polynomLimitNoFI.js +20 -14
- package/lib/exercises/limits/rationalFracForbiddenValueLimit.d.ts +6 -6
- package/lib/exercises/limits/rationalFracForbiddenValueLimit.d.ts.map +1 -1
- package/lib/exercises/limits/rationalFracForbiddenValueLimit.js +32 -20
- package/lib/exercises/limits/rationalFracLimit.d.ts +6 -6
- package/lib/exercises/limits/rationalFracLimit.d.ts.map +1 -1
- package/lib/exercises/limits/rationalFracLimit.js +52 -15
- package/lib/exercises/limits/sequenceGeometricLimit.d.ts +3 -5
- package/lib/exercises/limits/sequenceGeometricLimit.d.ts.map +1 -1
- package/lib/exercises/limits/sequenceGeometricLimit.js +23 -15
- package/lib/exercises/limits/sequencePolynomLimit.d.ts +3 -5
- package/lib/exercises/limits/sequencePolynomLimit.d.ts.map +1 -1
- package/lib/exercises/limits/sequencePolynomLimit.js +21 -15
- package/lib/exercises/limits/sequencePolynomNoFILimit.d.ts +3 -5
- package/lib/exercises/limits/sequencePolynomNoFILimit.d.ts.map +1 -1
- package/lib/exercises/limits/sequencePolynomNoFILimit.js +21 -15
- package/lib/exercises/limits/sequencePolynomProductLimit.d.ts +5 -6
- package/lib/exercises/limits/sequencePolynomProductLimit.d.ts.map +1 -1
- package/lib/exercises/limits/sequencePolynomProductLimit.js +35 -19
- package/lib/exercises/limits/sequenceRationalFracLimit.d.ts +5 -6
- package/lib/exercises/limits/sequenceRationalFracLimit.d.ts.map +1 -1
- package/lib/exercises/limits/sequenceRationalFracLimit.js +55 -18
- package/lib/exercises/percent/applyPercent.d.ts +6 -5
- package/lib/exercises/percent/applyPercent.d.ts.map +1 -1
- package/lib/exercises/percent/applyPercent.js +32 -14
- package/lib/exercises/percent/averageEvolutionRate.d.ts +5 -5
- package/lib/exercises/percent/averageEvolutionRate.d.ts.map +1 -1
- package/lib/exercises/percent/averageEvolutionRate.js +17 -11
- package/lib/exercises/percent/evolutionToCM.d.ts +3 -5
- package/lib/exercises/percent/evolutionToCM.d.ts.map +1 -1
- package/lib/exercises/percent/evolutionToCM.js +24 -15
- package/lib/exercises/percent/globalPercent.d.ts +4 -5
- package/lib/exercises/percent/globalPercent.d.ts.map +1 -1
- package/lib/exercises/percent/globalPercent.js +23 -13
- package/lib/exercises/percent/index.d.ts +6 -0
- package/lib/exercises/percent/index.d.ts.map +1 -0
- package/lib/exercises/percent/index.js +21 -0
- package/lib/exercises/percent/reciprocalPercentage.d.ts +5 -5
- package/lib/exercises/percent/reciprocalPercentage.d.ts.map +1 -1
- package/lib/exercises/percent/reciprocalPercentage.js +25 -14
- package/lib/exercises/powers/calculateNegativePower.d.ts +3 -5
- package/lib/exercises/powers/calculateNegativePower.d.ts.map +1 -1
- package/lib/exercises/powers/calculateNegativePower.js +38 -22
- package/lib/exercises/powers/calculatePower.d.ts +3 -5
- package/lib/exercises/powers/calculatePower.d.ts.map +1 -1
- package/lib/exercises/powers/calculatePower.js +26 -22
- package/lib/exercises/powers/decimalToScientific.d.ts +3 -5
- package/lib/exercises/powers/decimalToScientific.d.ts.map +1 -1
- package/lib/exercises/powers/decimalToScientific.js +25 -18
- package/lib/exercises/powers/index.d.ts +10 -0
- package/lib/exercises/powers/index.d.ts.map +1 -0
- package/lib/exercises/powers/index.js +25 -0
- package/lib/exercises/powers/powerDefinition.d.ts +3 -5
- package/lib/exercises/powers/powerDefinition.d.ts.map +1 -1
- package/lib/exercises/powers/powerDefinition.js +15 -10
- package/lib/exercises/powers/powersDivision.d.ts +4 -6
- package/lib/exercises/powers/powersDivision.d.ts.map +1 -1
- package/lib/exercises/powers/powersDivision.js +36 -14
- package/lib/exercises/powers/powersOfTenToDecimal.d.ts +3 -5
- package/lib/exercises/powers/powersOfTenToDecimal.d.ts.map +1 -1
- package/lib/exercises/powers/powersOfTenToDecimal.js +26 -20
- package/lib/exercises/powers/powersPower.d.ts +4 -6
- package/lib/exercises/powers/powersPower.d.ts.map +1 -1
- package/lib/exercises/powers/powersPower.js +41 -18
- package/lib/exercises/powers/powersProduct.d.ts +4 -6
- package/lib/exercises/powers/powersProduct.d.ts.map +1 -1
- package/lib/exercises/powers/powersProduct.js +36 -13
- package/lib/exercises/powers/scientificToDecimal.d.ts +3 -5
- package/lib/exercises/powers/scientificToDecimal.d.ts.map +1 -1
- package/lib/exercises/powers/scientificToDecimal.js +24 -18
- package/lib/exercises/primitive/constantPrimitive.d.ts +10 -0
- package/lib/exercises/primitive/constantPrimitive.d.ts.map +1 -0
- package/lib/exercises/primitive/constantPrimitive.js +56 -0
- package/lib/exercises/primitive/expUPrimitive.d.ts +10 -0
- package/lib/exercises/primitive/expUPrimitive.d.ts.map +1 -0
- package/lib/exercises/primitive/expUPrimitive.js +76 -0
- package/lib/exercises/primitive/exponentialPrimitive.d.ts +10 -0
- package/lib/exercises/primitive/exponentialPrimitive.d.ts.map +1 -0
- package/lib/exercises/primitive/exponentialPrimitive.js +72 -0
- package/lib/exercises/primitive/index.d.ts +8 -0
- package/lib/exercises/primitive/index.d.ts.map +1 -0
- package/lib/exercises/primitive/index.js +31 -0
- package/lib/exercises/primitive/logarithmePrimitive.d.ts +9 -0
- package/lib/exercises/primitive/logarithmePrimitive.d.ts.map +1 -0
- package/lib/exercises/primitive/logarithmePrimitive.js +79 -0
- package/lib/exercises/primitive/polynomialPrimitive.d.ts +10 -0
- package/lib/exercises/primitive/polynomialPrimitive.d.ts.map +1 -0
- package/lib/exercises/primitive/polynomialPrimitive.js +60 -0
- package/lib/exercises/primitive/sinCosPrimitive.d.ts +11 -0
- package/lib/exercises/primitive/sinCosPrimitive.d.ts.map +1 -0
- package/lib/exercises/primitive/sinCosPrimitive.js +79 -0
- package/lib/exercises/primitive/sinUCosUPrimitive.d.ts +11 -0
- package/lib/exercises/primitive/sinUCosUPrimitive.d.ts.map +1 -0
- package/lib/exercises/primitive/sinUCosUPrimitive.js +85 -0
- package/lib/exercises/primitive/usualPrimitives.d.ts +11 -0
- package/lib/exercises/primitive/usualPrimitives.d.ts.map +1 -0
- package/lib/exercises/primitive/usualPrimitives.js +108 -0
- package/lib/exercises/probaStat/ballsBasicProbas.d.ts +5 -7
- package/lib/exercises/probaStat/ballsBasicProbas.d.ts.map +1 -1
- package/lib/exercises/probaStat/ballsBasicProbas.js +24 -12
- package/lib/exercises/probaStat/cardBasicProbas.d.ts +3 -5
- package/lib/exercises/probaStat/cardBasicProbas.d.ts.map +1 -1
- package/lib/exercises/probaStat/cardBasicProbas.js +49 -28
- package/lib/exercises/probaStat/conditionalProbability.d.ts +7 -5
- package/lib/exercises/probaStat/conditionalProbability.d.ts.map +1 -1
- package/lib/exercises/probaStat/conditionalProbability.js +24 -19
- package/lib/exercises/probaStat/diceBasicProbas.d.ts +3 -5
- package/lib/exercises/probaStat/diceBasicProbas.d.ts.map +1 -1
- package/lib/exercises/probaStat/diceBasicProbas.js +27 -11
- package/lib/exercises/probaStat/index.d.ts +8 -0
- package/lib/exercises/probaStat/index.d.ts.map +1 -0
- package/lib/exercises/probaStat/index.js +23 -0
- package/lib/exercises/probaStat/probabilityTree.d.ts +3 -7
- package/lib/exercises/probaStat/probabilityTree.d.ts.map +1 -1
- package/lib/exercises/probaStat/probabilityTree.js +62 -51
- package/lib/exercises/probaStat/stats1var/averageWithTable.d.ts +8 -0
- package/lib/exercises/probaStat/stats1var/averageWithTable.d.ts.map +1 -0
- package/lib/exercises/probaStat/stats1var/averageWithTable.js +68 -0
- package/lib/exercises/probaStat/stats1var/index.d.ts +7 -0
- package/lib/exercises/probaStat/stats1var/index.d.ts.map +1 -0
- package/lib/exercises/probaStat/stats1var/index.js +22 -0
- package/lib/exercises/probaStat/stats1var/marginalAndConditionalFrequency.d.ts +11 -0
- package/lib/exercises/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -0
- package/lib/exercises/probaStat/stats1var/marginalAndConditionalFrequency.js +129 -0
- package/lib/exercises/probaStat/stats1var/median.d.ts +7 -0
- package/lib/exercises/probaStat/stats1var/median.d.ts.map +1 -0
- package/lib/exercises/probaStat/stats1var/median.js +71 -0
- package/lib/exercises/probaStat/stats1var/medianList.d.ts +7 -0
- package/lib/exercises/probaStat/stats1var/medianList.d.ts.map +1 -0
- package/lib/exercises/probaStat/stats1var/medianList.js +56 -0
- package/lib/exercises/probaStat/stats1var/quartiles.d.ts +9 -0
- package/lib/exercises/probaStat/stats1var/quartiles.d.ts.map +1 -0
- package/lib/exercises/probaStat/stats1var/quartiles.js +84 -0
- package/lib/exercises/probaStat/stats1var/quartilesList.d.ts +8 -0
- package/lib/exercises/probaStat/stats1var/quartilesList.d.ts.map +1 -0
- package/lib/exercises/probaStat/stats1var/quartilesList.js +72 -0
- package/lib/exercises/probaStat/stats2var/averagePoint.d.ts +5 -5
- package/lib/exercises/probaStat/stats2var/averagePoint.d.ts.map +1 -1
- package/lib/exercises/probaStat/stats2var/averagePoint.js +29 -11
- package/lib/exercises/probaStat/stats2var/index.d.ts +2 -0
- package/lib/exercises/probaStat/stats2var/index.d.ts.map +1 -0
- package/lib/exercises/probaStat/stats2var/index.js +17 -0
- package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts +3 -5
- package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +12 -8
- package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts +3 -5
- package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.js +22 -10
- package/lib/exercises/sequences/arithmetic/arithmeticFindReason.d.ts +6 -5
- package/lib/exercises/sequences/arithmetic/arithmeticFindReason.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticFindReason.js +14 -10
- package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.d.ts +6 -5
- package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.js +12 -8
- package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts +6 -5
- package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.js +12 -8
- package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.d.ts +3 -5
- package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.js +14 -10
- package/lib/exercises/sequences/arithmetic/firstIntegersSum.d.ts +3 -5
- package/lib/exercises/sequences/arithmetic/firstIntegersSum.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/firstIntegersSum.js +12 -8
- package/lib/exercises/sequences/arithmetic/index.d.ts +8 -0
- package/lib/exercises/sequences/arithmetic/index.d.ts.map +1 -0
- package/lib/exercises/sequences/arithmetic/index.js +23 -0
- package/lib/exercises/sequences/explicitFormulaUsage.d.ts +3 -5
- package/lib/exercises/sequences/explicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/explicitFormulaUsage.js +15 -11
- package/lib/exercises/sequences/genericSequenceVariations.d.ts +4 -6
- package/lib/exercises/sequences/genericSequenceVariations.d.ts.map +1 -1
- package/lib/exercises/sequences/genericSequenceVariations.js +22 -18
- package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.d.ts +3 -5
- package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.js +13 -10
- package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.d.ts +3 -5
- package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.js +24 -13
- package/lib/exercises/sequences/geometric/geometricFindReason.d.ts +5 -6
- package/lib/exercises/sequences/geometric/geometricFindReason.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricFindReason.js +16 -11
- package/lib/exercises/sequences/geometric/geometricFirstTermsSum.d.ts +3 -5
- package/lib/exercises/sequences/geometric/geometricFirstTermsSum.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricFirstTermsSum.js +23 -11
- package/lib/exercises/sequences/geometric/geometricReasonUsage.d.ts +4 -5
- package/lib/exercises/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricReasonUsage.js +12 -8
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts +4 -5
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.js +13 -9
- package/lib/exercises/sequences/geometric/index.d.ts +7 -0
- package/lib/exercises/sequences/geometric/index.d.ts.map +1 -0
- package/lib/exercises/sequences/geometric/index.js +22 -0
- package/lib/exercises/sequences/index.d.ts +6 -0
- package/lib/exercises/sequences/index.d.ts.map +1 -0
- package/lib/exercises/sequences/index.js +21 -0
- package/lib/exercises/sequences/recurrenceFormulaUsage.d.ts +3 -5
- package/lib/exercises/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/recurrenceFormulaUsage.js +15 -11
- package/lib/exercises/sets/index.d.ts +3 -0
- package/lib/exercises/sets/index.d.ts.map +1 -0
- package/lib/exercises/sets/index.js +18 -0
- package/lib/exercises/sets/intervals/index.d.ts +4 -0
- package/lib/exercises/sets/intervals/index.d.ts.map +1 -0
- package/lib/exercises/sets/intervals/index.js +19 -0
- package/lib/exercises/sets/intervals/inequalityToInterval.d.ts +3 -5
- package/lib/exercises/sets/intervals/inequalityToInterval.d.ts.map +1 -1
- package/lib/exercises/sets/intervals/inequalityToInterval.js +92 -45
- package/lib/exercises/sets/intervals/intervalsIntersection.d.ts +3 -5
- package/lib/exercises/sets/intervals/intervalsIntersection.d.ts.map +1 -1
- package/lib/exercises/sets/intervals/intervalsIntersection.js +19 -7
- package/lib/exercises/sets/intervals/intervalsUnion.d.ts +3 -5
- package/lib/exercises/sets/intervals/intervalsUnion.d.ts.map +1 -1
- package/lib/exercises/sets/intervals/intervalsUnion.js +11 -7
- package/lib/exercises/sets/setBelonging.d.ts +5 -5
- package/lib/exercises/sets/setBelonging.d.ts.map +1 -1
- package/lib/exercises/sets/setBelonging.js +32 -19
- package/lib/exercises/squareRoots/index.d.ts +3 -0
- package/lib/exercises/squareRoots/index.d.ts.map +1 -0
- package/lib/exercises/squareRoots/index.js +18 -0
- package/lib/exercises/squareRoots/simpifySquareRoot.d.ts +4 -5
- package/lib/exercises/squareRoots/simpifySquareRoot.d.ts.map +1 -1
- package/lib/exercises/squareRoots/simpifySquareRoot.js +13 -7
- package/lib/exercises/squareRoots/squareRootEquation.d.ts +3 -5
- package/lib/exercises/squareRoots/squareRootEquation.d.ts.map +1 -1
- package/lib/exercises/squareRoots/squareRootEquation.js +20 -10
- package/lib/exercises/trigonometry/index.d.ts +6 -0
- package/lib/exercises/trigonometry/index.d.ts.map +1 -0
- package/lib/exercises/trigonometry/index.js +21 -0
- package/lib/exercises/trigonometry/mainRemarkableValues.d.ts +5 -5
- package/lib/exercises/trigonometry/mainRemarkableValues.d.ts.map +1 -1
- package/lib/exercises/trigonometry/mainRemarkableValues.js +33 -20
- package/lib/exercises/trigonometry/remarkableValues.d.ts +5 -5
- package/lib/exercises/trigonometry/remarkableValues.d.ts.map +1 -1
- package/lib/exercises/trigonometry/remarkableValues.js +29 -18
- package/lib/exercises/trigonometry/trigonometry.d.ts +11 -0
- package/lib/exercises/trigonometry/trigonometry.d.ts.map +1 -0
- package/lib/exercises/trigonometry/trigonometry.js +114 -0
- package/lib/exercises/trigonometry/trigonometryAngleCalcul.d.ts +9 -0
- package/lib/exercises/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -0
- package/lib/exercises/trigonometry/trigonometryAngleCalcul.js +73 -0
- package/lib/exercises/trigonometry/trigonometrySideCalcul.d.ts +10 -0
- package/lib/exercises/trigonometry/trigonometrySideCalcul.d.ts.map +1 -0
- package/lib/exercises/trigonometry/trigonometrySideCalcul.js +85 -0
- package/lib/exercises/utils/getDistinctQuestions.d.ts +2 -2
- package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
- package/lib/exercises/utils/getDistinctQuestions.js +2 -3
- package/lib/exercises/utils/keys/equationKeys.d.ts +3 -0
- package/lib/exercises/utils/keys/equationKeys.d.ts.map +1 -0
- package/lib/exercises/utils/keys/equationKeys.js +12 -0
- package/lib/exercises/utils/keys/inequationKeys.d.ts +3 -0
- package/lib/exercises/utils/keys/inequationKeys.d.ts.map +1 -0
- package/lib/exercises/utils/keys/inequationKeys.js +17 -0
- package/lib/index.d.ts +692 -15
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +51 -23
- package/lib/math/complex/complex.d.ts +4 -3
- package/lib/math/complex/complex.d.ts.map +1 -1
- package/lib/math/complex/complex.js +15 -17
- package/lib/math/geometry/point.d.ts +3 -4
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +23 -22
- package/lib/math/geometry/vector.d.ts +2 -2
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +15 -5
- package/lib/math/numbers/decimals/decimal.d.ts +2 -2
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +24 -21
- package/lib/math/numbers/integer/integer.d.ts +6 -2
- package/lib/math/numbers/integer/integer.d.ts.map +1 -1
- package/lib/math/numbers/integer/integer.js +34 -7
- package/lib/math/numbers/integer/power.d.ts +2 -2
- package/lib/math/numbers/integer/power.d.ts.map +1 -1
- package/lib/math/numbers/integer/power.js +6 -6
- package/lib/math/numbers/integer/primes.d.ts.map +1 -1
- package/lib/math/numbers/integer/primes.js +4 -1
- package/lib/math/numbers/nombre.d.ts +3 -8
- package/lib/math/numbers/nombre.d.ts.map +1 -1
- package/lib/math/numbers/nombre.js +6 -1
- package/lib/math/numbers/rationals/rational.d.ts +7 -10
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.js +16 -10
- package/lib/math/numbers/reals/extendedRingElement.d.ts +3 -1
- package/lib/math/numbers/reals/extendedRingElement.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.d.ts +2 -1
- package/lib/math/numbers/reals/real.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.js +11 -1
- package/lib/math/polynomials/polynomial.d.ts +9 -6
- package/lib/math/polynomials/polynomial.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.js +102 -35
- package/lib/math/polynomials/rationalFrac.d.ts +12 -0
- package/lib/math/polynomials/rationalFrac.d.ts.map +1 -0
- package/lib/math/polynomials/rationalFrac.js +50 -0
- package/lib/math/polynomials/trinom.d.ts +6 -5
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +57 -22
- package/lib/math/sets/intervals/intervals.d.ts +11 -16
- package/lib/math/sets/intervals/intervals.d.ts.map +1 -1
- package/lib/math/sets/intervals/intervals.js +77 -63
- package/lib/math/trigonometry/remarkableValue.d.ts +7 -2
- package/lib/math/trigonometry/remarkableValue.d.ts.map +1 -1
- package/lib/math/trigonometry/remarkableValue.js +16 -5
- package/lib/math/trigonometry/remarkableValues.d.ts +1 -1
- package/lib/math/trigonometry/remarkableValues.d.ts.map +1 -1
- package/lib/math/trigonometry/remarkableValues.js +11 -0
- package/lib/math/utils/latex/frenchify.d.ts +1 -1
- package/lib/math/utils/latex/frenchify.d.ts.map +1 -1
- package/lib/math/utils/latex/frenchify.js +3 -1
- package/lib/server.d.ts +2 -1
- package/lib/server.d.ts.map +1 -1
- package/lib/server.js +58 -14
- package/lib/tree/nodes/algebraicNode.d.ts +4 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -0
- package/lib/tree/nodes/algebraicNode.js +5 -0
- package/lib/tree/nodes/complex/complexNode.d.ts +7 -10
- package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
- package/lib/tree/nodes/complex/complexNode.js +20 -41
- package/lib/tree/nodes/equations/equalNode.d.ts +14 -0
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -0
- package/lib/tree/nodes/equations/equalNode.js +41 -0
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts +21 -0
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -0
- package/lib/tree/nodes/equations/equationSolutionNode.js +44 -0
- package/lib/tree/nodes/equations/multiEqualNode.d.ts +14 -0
- package/lib/tree/nodes/equations/multiEqualNode.d.ts.map +1 -0
- package/lib/tree/nodes/equations/multiEqualNode.js +39 -0
- package/lib/tree/nodes/functions/absNode.d.ts +17 -0
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -0
- package/lib/tree/nodes/functions/absNode.js +41 -0
- package/lib/tree/nodes/functions/cosNode.d.ts +8 -4
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +8 -3
- package/lib/tree/nodes/functions/expNode.d.ts +9 -9
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.js +13 -5
- package/lib/tree/nodes/functions/functionNode.d.ts +7 -7
- package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/functionNode.js +6 -10
- package/lib/tree/nodes/functions/logNode.d.ts +9 -4
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.js +20 -5
- package/lib/tree/nodes/functions/oppositeNode.d.ts +17 -6
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +55 -14
- package/lib/tree/nodes/functions/sinNode.d.ts +8 -4
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +8 -3
- package/lib/tree/nodes/functions/sqrtNode.d.ts +10 -5
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +26 -5
- package/lib/tree/nodes/geometry/lengthNode.d.ts +14 -0
- package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -0
- package/lib/tree/nodes/geometry/lengthNode.js +33 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts +15 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -0
- package/lib/tree/nodes/geometry/pointNode.js +41 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts +14 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts.map +1 -0
- package/lib/tree/nodes/geometry/vectorNode.js +30 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts +21 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -0
- package/lib/tree/nodes/inequations/inequationNode.js +116 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +21 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +46 -0
- package/lib/tree/nodes/node.d.ts +22 -3
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +7 -0
- package/lib/tree/nodes/numbers/constantNode.d.ts +4 -2
- package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/constantNode.js +5 -1
- package/lib/tree/nodes/numbers/infiniteNode.d.ts +5 -0
- package/lib/tree/nodes/numbers/infiniteNode.d.ts.map +1 -0
- package/lib/tree/nodes/numbers/infiniteNode.js +7 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts +4 -2
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +9 -5
- package/lib/tree/nodes/numbers/percentNode.d.ts +12 -0
- package/lib/tree/nodes/numbers/percentNode.d.ts.map +1 -0
- package/lib/tree/nodes/numbers/percentNode.js +26 -0
- package/lib/tree/nodes/operators/addNode.d.ts +15 -6
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +53 -14
- package/lib/tree/nodes/operators/divideNode.d.ts +11 -5
- package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/divideNode.js +20 -10
- package/lib/tree/nodes/operators/fractionNode.d.ts +14 -11
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +28 -17
- package/lib/tree/nodes/operators/multiplyNode.d.ts +16 -11
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +154 -33
- package/lib/tree/nodes/operators/operatorNode.d.ts +11 -12
- package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/operatorNode.js +4 -22
- package/lib/tree/nodes/operators/powerNode.d.ts +14 -9
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +21 -8
- package/lib/tree/nodes/operators/substractNode.d.ts +8 -3
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +15 -5
- package/lib/tree/nodes/sets/belongsNode.d.ts +15 -0
- package/lib/tree/nodes/sets/belongsNode.d.ts.map +1 -0
- package/lib/tree/nodes/sets/belongsNode.js +36 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts +15 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -0
- package/lib/tree/nodes/sets/discreteSetNode.js +54 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts +24 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -0
- package/lib/tree/nodes/sets/intervalNode.js +71 -0
- package/lib/tree/nodes/sets/setNode.d.ts +4 -0
- package/lib/tree/nodes/sets/setNode.d.ts.map +1 -0
- package/lib/tree/nodes/sets/setNode.js +2 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts +20 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -0
- package/lib/tree/nodes/sets/unionIntervalNode.js +44 -0
- package/lib/tree/nodes/variables/variableNode.d.ts +2 -1
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +5 -1
- package/lib/tree/parsers/simplify.d.ts +1 -1
- package/lib/tree/parsers/simplify.d.ts.map +1 -1
- package/lib/tree/parsers/simplify.js +15 -15
- package/lib/tree/utilities/functionComposition.d.ts +5 -0
- package/lib/tree/utilities/functionComposition.d.ts.map +1 -0
- package/lib/tree/utilities/functionComposition.js +14 -0
- package/lib/tree/utilities/operatorComposition.d.ts +5 -0
- package/lib/tree/utilities/operatorComposition.d.ts.map +1 -0
- package/lib/tree/utilities/operatorComposition.js +14 -0
- package/lib/types/class.d.ts +4 -0
- package/lib/types/class.d.ts.map +1 -0
- package/lib/types/class.js +2 -0
- package/lib/utils/cartesianProducts.d.ts +13 -0
- package/lib/utils/cartesianProducts.d.ts.map +1 -0
- package/lib/utils/cartesianProducts.js +64 -0
- package/lib/utils/isInt.d.ts +2 -0
- package/lib/utils/isInt.d.ts.map +1 -0
- package/lib/utils/isInt.js +7 -0
- package/lib/utils/isLetter.d.ts +2 -0
- package/lib/utils/isLetter.d.ts.map +1 -0
- package/lib/utils/isLetter.js +7 -0
- package/lib/utils/permutations.d.ts +2 -0
- package/lib/utils/permutations.d.ts.map +1 -0
- package/lib/utils/permutations.js +21 -0
- package/package.json +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.primes = void 0;
|
|
4
|
-
exports.primes = [
|
|
4
|
+
exports.primes = [
|
|
5
|
+
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
|
|
6
|
+
73, 79, 83, 89, 97,
|
|
7
|
+
];
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
import { Node } from
|
|
2
|
-
import {
|
|
3
|
-
import { Integer } from './integer/integer';
|
|
1
|
+
import { Node, NodeOptions } from "../../tree/nodes/node";
|
|
2
|
+
import { Integer } from "./integer/integer";
|
|
4
3
|
export declare enum NumberType {
|
|
5
4
|
Integer = 0,
|
|
6
5
|
Decimal = 1,
|
|
7
6
|
Rational = 2,
|
|
8
7
|
Real = 3
|
|
9
8
|
}
|
|
10
|
-
type ToTreeOpts = {
|
|
11
|
-
FractionNodeOpts?: FractionNodeOptions;
|
|
12
|
-
};
|
|
13
9
|
export interface Nombre {
|
|
14
10
|
value: number;
|
|
15
11
|
tex: string;
|
|
16
12
|
type: NumberType;
|
|
17
|
-
toTree: (opts?:
|
|
13
|
+
toTree: (opts?: NodeOptions) => Node;
|
|
18
14
|
}
|
|
19
15
|
export declare abstract class NombreConstructor {
|
|
20
16
|
static random(): import("./decimals/decimal").Decimal | Integer | import("./rationals/rational").Rational | import("./reals/real").Real;
|
|
21
17
|
}
|
|
22
|
-
export {};
|
|
23
18
|
//# sourceMappingURL=nombre.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nombre.d.ts","sourceRoot":"","sources":["../../../src/math/numbers/nombre.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"nombre.d.ts","sourceRoot":"","sources":["../../../src/math/numbers/nombre.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAI1D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAI5C,oBAAY,UAAU;IACpB,OAAO,IAAA;IACP,OAAO,IAAA;IACP,QAAQ,IAAA;IACR,IAAI,IAAA;CACL;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;CACtC;AAED,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,MAAM;CAkBd"}
|
|
@@ -16,7 +16,12 @@ var NumberType;
|
|
|
16
16
|
})(NumberType = exports.NumberType || (exports.NumberType = {}));
|
|
17
17
|
class NombreConstructor {
|
|
18
18
|
static random() {
|
|
19
|
-
const type = (0, random_1.random)([
|
|
19
|
+
const type = (0, random_1.random)([
|
|
20
|
+
NumberType.Decimal,
|
|
21
|
+
NumberType.Decimal,
|
|
22
|
+
NumberType.Rational,
|
|
23
|
+
NumberType.Real,
|
|
24
|
+
]);
|
|
20
25
|
switch (type) {
|
|
21
26
|
case NumberType.Integer:
|
|
22
27
|
return new integer_1.Integer((0, randint_1.randint)(-9, 10));
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { Node } from
|
|
2
|
-
import {
|
|
3
|
-
import { Nombre, NumberType } from
|
|
4
|
-
type ToTreeOpts = {
|
|
5
|
-
FractionNodeOpts?: FractionNodeOptions;
|
|
6
|
-
};
|
|
1
|
+
import { Node, NodeOptions } from "../../../tree/nodes/node";
|
|
2
|
+
import { Integer } from "../integer/integer";
|
|
3
|
+
import { Nombre, NumberType } from "../nombre";
|
|
7
4
|
export declare abstract class RationalConstructor {
|
|
8
5
|
/**
|
|
9
6
|
* @param maxGcd max number by which the fraction is simplifiable
|
|
@@ -22,11 +19,11 @@ export declare class Rational implements Nombre {
|
|
|
22
19
|
constructor(numerator: number, denumerator: number);
|
|
23
20
|
toTex(): string;
|
|
24
21
|
add(nb: Nombre): Nombre;
|
|
25
|
-
multiply(nb: Nombre):
|
|
22
|
+
multiply(nb: Nombre): Rational | Integer;
|
|
26
23
|
divide(nb: Nombre): Nombre;
|
|
27
24
|
opposite(): Rational;
|
|
28
|
-
toTree(opts?:
|
|
29
|
-
|
|
25
|
+
toTree(opts?: NodeOptions): Node;
|
|
26
|
+
isIrreductible(): boolean;
|
|
27
|
+
simplify(): Integer | Rational;
|
|
30
28
|
}
|
|
31
|
-
export {};
|
|
32
29
|
//# sourceMappingURL=rational.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rational.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/rationals/rational.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"rational.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/rationals/rational.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAM1D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,8BAAsB,mBAAmB;IACvC;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,MAAM,GAAE,MAAW;IAW7C,MAAM,CAAC,kBAAkB,CAAC,GAAG,GAAE,MAAW;IAO1C,MAAM,CAAC,0BAA0B,CAAC,GAAG,GAAE,MAAW;CAQnD;AAED,qBAAa,QAAS,YAAW,MAAM;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;gBAEL,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAYlD,KAAK;IAML,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAkBvB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO;IAgBxC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAgB1B,QAAQ,IAAI,QAAQ;IAIpB,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI;IAgBhC,cAAc;IAId,QAAQ,IAAI,OAAO,GAAG,QAAQ;CAY/B"}
|
|
@@ -50,16 +50,16 @@ exports.RationalConstructor = RationalConstructor;
|
|
|
50
50
|
class Rational {
|
|
51
51
|
constructor(numerator, denumerator) {
|
|
52
52
|
if (denumerator === 0)
|
|
53
|
-
throw Error(
|
|
53
|
+
throw Error("division by zero");
|
|
54
54
|
this.num = numerator;
|
|
55
55
|
this.denum = denumerator;
|
|
56
56
|
this.value = numerator / denumerator;
|
|
57
57
|
this.isSimplified = Math.abs((0, gcd_1.gcd)(numerator, denumerator)) === 1;
|
|
58
|
-
this.tex = `${this.num < 0 ?
|
|
58
|
+
this.tex = `${this.num < 0 ? "-" : ""}\\frac{${this.num < 0 ? -this.num : this.num}}{${this.denum}}`;
|
|
59
59
|
this.type = nombre_1.NumberType.Rational;
|
|
60
60
|
}
|
|
61
61
|
toTex() {
|
|
62
|
-
return `${this.num < 0 ?
|
|
62
|
+
return `${this.num < 0 ? "-" : ""}\\frac{${this.num < 0 ? -this.num : this.num}}{${this.denum}}`;
|
|
63
63
|
}
|
|
64
64
|
add(nb) {
|
|
65
65
|
switch (nb.type) {
|
|
@@ -70,11 +70,12 @@ class Rational {
|
|
|
70
70
|
case nombre_1.NumberType.Rational: {
|
|
71
71
|
const rational = nb;
|
|
72
72
|
const ppcm = (0, lcd_1.lcd)(rational.denum, this.denum);
|
|
73
|
-
const num = this.num * (ppcm / this.denum) +
|
|
73
|
+
const num = this.num * (ppcm / this.denum) +
|
|
74
|
+
rational.num * (ppcm / rational.denum);
|
|
74
75
|
return new Rational(num, ppcm).simplify();
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
|
-
throw Error(
|
|
78
|
+
throw Error("not implemented yet");
|
|
78
79
|
}
|
|
79
80
|
multiply(nb) {
|
|
80
81
|
switch (nb.type) {
|
|
@@ -90,7 +91,7 @@ class Rational {
|
|
|
90
91
|
return new Rational(num, denum).simplify();
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
throw Error(
|
|
94
|
+
throw Error("not implemented yet");
|
|
94
95
|
}
|
|
95
96
|
divide(nb) {
|
|
96
97
|
switch (nb.type) {
|
|
@@ -105,18 +106,23 @@ class Rational {
|
|
|
105
106
|
return new Rational(num, denum).simplify();
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
|
-
throw Error(
|
|
109
|
+
throw Error("not implemented yet");
|
|
109
110
|
}
|
|
110
111
|
opposite() {
|
|
111
112
|
return new Rational(-this.num, this.denum);
|
|
112
113
|
}
|
|
113
114
|
toTree(opts) {
|
|
114
115
|
if (this.num < 0)
|
|
115
|
-
return new oppositeNode_1.OppositeNode(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-this.num), new numberNode_1.NumberNode(this.denum), opts
|
|
116
|
-
return new fractionNode_1.FractionNode(new numberNode_1.NumberNode(this.num), new numberNode_1.NumberNode(this.denum), opts
|
|
116
|
+
return new oppositeNode_1.OppositeNode(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-this.num), new numberNode_1.NumberNode(this.denum), opts));
|
|
117
|
+
return new fractionNode_1.FractionNode(new numberNode_1.NumberNode(this.num), new numberNode_1.NumberNode(this.denum), opts);
|
|
118
|
+
}
|
|
119
|
+
isIrreductible() {
|
|
120
|
+
return this.denum !== 1 && (0, gcd_1.gcd)(this.num, this.denum) === 1;
|
|
117
121
|
}
|
|
118
122
|
simplify() {
|
|
119
|
-
const sign = (this.num > 0 && this.denum > 0) || (this.num < 0 && this.denum < 0)
|
|
123
|
+
const sign = (this.num > 0 && this.denum > 0) || (this.num < 0 && this.denum < 0)
|
|
124
|
+
? 1
|
|
125
|
+
: -1;
|
|
120
126
|
const div = Math.abs((0, gcd_1.gcd)(this.num, this.denum));
|
|
121
127
|
if (Math.abs(this.denum) === div)
|
|
122
128
|
return new integer_1.Integer(this.num / this.denum);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NumberNode } from '../../../tree/nodes/numbers/numberNode';
|
|
2
|
+
import { SubstractNode } from '../../../tree/nodes/operators/substractNode';
|
|
1
3
|
import { Nombre } from '../nombre';
|
|
2
4
|
/**
|
|
3
5
|
* element of Q(x)
|
|
@@ -8,6 +10,6 @@ export declare class ExtendedRingElement {
|
|
|
8
10
|
b: number;
|
|
9
11
|
algebraicElement: Nombre;
|
|
10
12
|
constructor(a: number, b: number, algebraicElement: Nombre);
|
|
11
|
-
toTree(): import("../../../tree/nodes/node").Node;
|
|
13
|
+
toTree(): import("../../../tree/nodes/node").Node | NumberNode | SubstractNode;
|
|
12
14
|
}
|
|
13
15
|
//# sourceMappingURL=extendedRingElement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extendedRingElement.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/reals/extendedRingElement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extendedRingElement.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/reals/extendedRingElement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAGjE,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;GAGG;AACH,qBAAa,mBAAmB;IAM9B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,gBAAgB,EAAE,MAAM,CAAC;gBACb,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM;IAM1D,MAAM;CAeP"}
|
|
@@ -14,7 +14,7 @@ export declare abstract class SquareRootConstructor {
|
|
|
14
14
|
/**
|
|
15
15
|
* @returns simplifiable square root type sqrt(c)=a*sqrt(b)
|
|
16
16
|
*/
|
|
17
|
-
static randomSimplifiable({ allowPerfectSquare, maxSquare }: {
|
|
17
|
+
static randomSimplifiable({ allowPerfectSquare, maxSquare, }: {
|
|
18
18
|
allowPerfectSquare?: boolean | undefined;
|
|
19
19
|
maxSquare?: number | undefined;
|
|
20
20
|
}): SquareRoot;
|
|
@@ -23,6 +23,7 @@ export declare abstract class SquareRootConstructor {
|
|
|
23
23
|
export declare class SquareRoot extends Real {
|
|
24
24
|
operand: number;
|
|
25
25
|
constructor(operand: number);
|
|
26
|
+
isSimplifiable(): boolean;
|
|
26
27
|
getSimplifiedCoeffs(): [number, number];
|
|
27
28
|
simplify(): Nombre;
|
|
28
29
|
toTex(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"real.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/reals/real.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAQ7C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,8BAAsB,eAAe;IACnC,MAAM,CAAC,MAAM;CAUd;AACD,qBAAa,IAAK,YAAW,MAAM;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;gBACL,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAKtC,MAAM,IAAI,IAAI;CAIf;AAED,8BAAsB,qBAAqB;IACzC;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"real.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/reals/real.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAQ7C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,8BAAsB,eAAe;IACnC,MAAM,CAAC,MAAM;CAUd;AACD,qBAAa,IAAK,YAAW,MAAM;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;gBACL,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAKtC,MAAM,IAAI,IAAI;CAIf;AAED,8BAAsB,qBAAqB;IACzC;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,EACxB,kBAA0B,EAC1B,SAAc,GACf;;;KAAA,GAAG,UAAU;IASd,MAAM,CAAC,kBAAkB,CAAC,GAAG,GAAE,MAAW,GAAG,UAAU;CAIxD;AAED,qBAAa,UAAW,SAAQ,IAAI;IAClC,OAAO,EAAE,MAAM,CAAC;gBACJ,OAAO,EAAE,MAAM;IAK3B,cAAc;IAMd,mBAAmB,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;IAiBvC,QAAQ,IAAI,MAAM;IAyBlB,KAAK,IAAI,MAAM;IAIf,MAAM,IAAI,IAAI;CAGf"}
|
|
@@ -43,7 +43,7 @@ class SquareRootConstructor {
|
|
|
43
43
|
/**
|
|
44
44
|
* @returns simplifiable square root type sqrt(c)=a*sqrt(b)
|
|
45
45
|
*/
|
|
46
|
-
static randomSimplifiable({ allowPerfectSquare = false, maxSquare = 11 }) {
|
|
46
|
+
static randomSimplifiable({ allowPerfectSquare = false, maxSquare = 11, }) {
|
|
47
47
|
const a = (0, randint_1.randint)(2, maxSquare);
|
|
48
48
|
let b;
|
|
49
49
|
let bMin = allowPerfectSquare ? 1 : 2;
|
|
@@ -63,7 +63,15 @@ class SquareRoot extends Real {
|
|
|
63
63
|
super(Math.sqrt(operand), `\\sqrt{${operand}}`);
|
|
64
64
|
this.operand = operand;
|
|
65
65
|
}
|
|
66
|
+
isSimplifiable() {
|
|
67
|
+
if (this.operand === 0 || this.operand === 1)
|
|
68
|
+
return true;
|
|
69
|
+
const [a, b] = this.getSimplifiedCoeffs();
|
|
70
|
+
return a !== 1;
|
|
71
|
+
}
|
|
66
72
|
getSimplifiedCoeffs() {
|
|
73
|
+
if (this.operand === 0)
|
|
74
|
+
return [1, 0];
|
|
67
75
|
const factors = (0, primeFactors_1.primeFactors)(this.operand);
|
|
68
76
|
// finds primes with even exponents
|
|
69
77
|
const multiples = [1];
|
|
@@ -81,6 +89,8 @@ class SquareRoot extends Real {
|
|
|
81
89
|
simplify() {
|
|
82
90
|
if (this.operand === 0)
|
|
83
91
|
return new integer_1.Integer(0);
|
|
92
|
+
if (this.operand === 1)
|
|
93
|
+
return new integer_1.Integer(1);
|
|
84
94
|
const [outsideSqrt, insideSqrt] = this.getSimplifiedCoeffs();
|
|
85
95
|
const simplified = insideSqrt !== 1
|
|
86
96
|
? new Real(outsideSqrt * Math.sqrt(insideSqrt), `${outsideSqrt === 1 ? "" : `${outsideSqrt}`}\\sqrt{${insideSqrt}}`)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Node } from
|
|
1
|
+
import { Node, NodeOptions } from "../../tree/nodes/node";
|
|
2
|
+
import { NumberNode } from "../../tree/nodes/numbers/numberNode";
|
|
2
3
|
export declare abstract class PolynomialConstructor {
|
|
3
4
|
static randomWithOrder(order: number, variable?: string): Polynomial;
|
|
4
5
|
static random(maxOrder: number, variable?: string): Polynomial;
|
|
@@ -11,7 +12,7 @@ export declare abstract class PolynomialConstructor {
|
|
|
11
12
|
*/
|
|
12
13
|
static randomWithLength(maxOrder: number, length: number, variable?: string): Polynomial;
|
|
13
14
|
static randomWithLengthAndSameSigns(maxOrder: number, length: number, variable?: string): Polynomial;
|
|
14
|
-
static randomNoFI(maxOrder: number, to:
|
|
15
|
+
static randomNoFI(maxOrder: number, to: "+\\infty" | "-\\infty", length?: number, variable?: string): Polynomial;
|
|
15
16
|
}
|
|
16
17
|
export declare class Polynomial {
|
|
17
18
|
degree: number;
|
|
@@ -28,15 +29,17 @@ export declare class Polynomial {
|
|
|
28
29
|
constructor(coefficients: number[], variable?: string);
|
|
29
30
|
equals(P: Polynomial): boolean;
|
|
30
31
|
getRoots(): number[];
|
|
31
|
-
add(P: Polynomial): Polynomial;
|
|
32
|
+
add(P: Polynomial | number): Polynomial;
|
|
32
33
|
times(nb: number): Polynomial;
|
|
33
34
|
multiply(Q: Polynomial): Polynomial;
|
|
35
|
+
scalarDivide(n: number): Polynomial;
|
|
34
36
|
opposite(): Polynomial;
|
|
35
37
|
derivate(): Polynomial;
|
|
36
|
-
|
|
38
|
+
integrateToNode(opts?: NodeOptions): Node;
|
|
37
39
|
calculate(x: number): number;
|
|
38
|
-
getLimit(to:
|
|
39
|
-
|
|
40
|
+
getLimit(to: "+\\infty" | "-\\infty"): string;
|
|
41
|
+
getLimitNode(to: "+\\infty" | "-\\infty"): NumberNode | import("../../tree/nodes/numbers/constantNode").ConstantNode;
|
|
42
|
+
toTree(opts?: NodeOptions): Node;
|
|
40
43
|
toTex(): string;
|
|
41
44
|
toString(): string;
|
|
42
45
|
}
|
|
@@ -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,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAejE,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;;;;;;OAMG;IACH,MAAM,CAAC,gBAAgB,CACrB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,MAAY;IAoBxB,MAAM,CAAC,4BAA4B,CACjC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,MAAY;IAqBxB,MAAM,CAAC,UAAU,CACf,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,UAAU,GAAG,UAAU,EAC3B,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,GAAE,MAAY;CAmCzB;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;IAY1D,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO;IAM9B,QAAQ,IAAI,MAAM,EAAE;IAkCpB,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU;IAyBvC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU;IAQ7B,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAuBnC,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,UAAU;IAMnC,QAAQ,IAAI,UAAU;IAOtB,QAAQ,IAAI,UAAU;IAmBtB,eAAe,CAAC,IAAI,CAAC,EAAE,WAAW;IA+BlC,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAO5B,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM;IAiB7C,YAAY,CAAC,EAAE,EAAE,UAAU,GAAG,UAAU;IAiBxC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI;IAuChC,KAAK,IAAI,MAAM;IAyBf,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -9,10 +9,12 @@ 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
11
|
const coinFlip_1 = require("../../utils/coinFlip");
|
|
12
|
+
const rational_1 = require("../numbers/rationals/rational");
|
|
13
|
+
const infiniteNode_1 = require("../../tree/nodes/numbers/infiniteNode");
|
|
12
14
|
class PolynomialConstructor {
|
|
13
|
-
static randomWithOrder(order, variable =
|
|
15
|
+
static randomWithOrder(order, variable = "x") {
|
|
14
16
|
if (order < 0) {
|
|
15
|
-
throw Error(
|
|
17
|
+
throw Error("Order must be a non-negative integer");
|
|
16
18
|
}
|
|
17
19
|
const coefficients = [];
|
|
18
20
|
for (let i = 0; i <= order - 1; i++) {
|
|
@@ -21,9 +23,9 @@ class PolynomialConstructor {
|
|
|
21
23
|
coefficients.push((0, randint_1.randint)(-9, 10, [0]));
|
|
22
24
|
return new Polynomial(coefficients, variable);
|
|
23
25
|
}
|
|
24
|
-
static random(maxOrder, variable =
|
|
26
|
+
static random(maxOrder, variable = "x") {
|
|
25
27
|
if (maxOrder < 0) {
|
|
26
|
-
throw Error(
|
|
28
|
+
throw Error("Order must be a non-negative integer");
|
|
27
29
|
}
|
|
28
30
|
const order = (0, randint_1.randint)(1, maxOrder + 1);
|
|
29
31
|
const coefficients = [];
|
|
@@ -40,9 +42,9 @@ class PolynomialConstructor {
|
|
|
40
42
|
* @param variable
|
|
41
43
|
* @returns
|
|
42
44
|
*/
|
|
43
|
-
static randomWithLength(maxOrder, length, variable =
|
|
45
|
+
static randomWithLength(maxOrder, length, variable = "x") {
|
|
44
46
|
if (maxOrder < 0) {
|
|
45
|
-
throw Error(
|
|
47
|
+
throw Error("Order must be a non-negative integer");
|
|
46
48
|
}
|
|
47
49
|
const order = (0, randint_1.randint)(1, maxOrder + 1);
|
|
48
50
|
const coefficients = [];
|
|
@@ -59,9 +61,9 @@ class PolynomialConstructor {
|
|
|
59
61
|
coefficients.push((0, randint_1.randint)(-9, 10, [0]));
|
|
60
62
|
return new Polynomial(coefficients, variable);
|
|
61
63
|
}
|
|
62
|
-
static randomWithLengthAndSameSigns(maxOrder, length, variable =
|
|
64
|
+
static randomWithLengthAndSameSigns(maxOrder, length, variable = "x") {
|
|
63
65
|
if (maxOrder < 0) {
|
|
64
|
-
throw Error(
|
|
66
|
+
throw Error("Order must be a non-negative integer");
|
|
65
67
|
}
|
|
66
68
|
const order = (0, randint_1.randint)(1, maxOrder + 1);
|
|
67
69
|
const coefficients = [];
|
|
@@ -79,13 +81,13 @@ class PolynomialConstructor {
|
|
|
79
81
|
coefficients.push(sign * (0, randint_1.randint)(0, 10, [0]));
|
|
80
82
|
return new Polynomial(coefficients, variable);
|
|
81
83
|
}
|
|
82
|
-
static randomNoFI(maxOrder, to, length, variable =
|
|
84
|
+
static randomNoFI(maxOrder, to, length, variable = "x") {
|
|
83
85
|
if (maxOrder < 0) {
|
|
84
|
-
throw Error(
|
|
86
|
+
throw Error("Order must be a non-negative integer");
|
|
85
87
|
}
|
|
86
88
|
const order = (0, randint_1.randint)(1, maxOrder + 1);
|
|
87
89
|
const fixedLength = length ?? order;
|
|
88
|
-
if (to ===
|
|
90
|
+
if (to === "+\\infty") {
|
|
89
91
|
return PolynomialConstructor.randomWithLengthAndSameSigns(maxOrder, fixedLength, variable);
|
|
90
92
|
}
|
|
91
93
|
//en -infini les degrés de parité différentes doivent avoir un signe différent
|
|
@@ -112,18 +114,20 @@ class Polynomial {
|
|
|
112
114
|
* @param coefficients coefficients[i] est le coeff de x^i
|
|
113
115
|
* @param variable
|
|
114
116
|
*/
|
|
115
|
-
constructor(coefficients, variable =
|
|
117
|
+
constructor(coefficients, variable = "x") {
|
|
116
118
|
if (coefficients.length === 0)
|
|
117
|
-
throw Error(
|
|
118
|
-
if (coefficients.length > 1 &&
|
|
119
|
-
|
|
119
|
+
throw Error("coeffs must be not null");
|
|
120
|
+
if (coefficients.length > 1 &&
|
|
121
|
+
coefficients[coefficients.length - 1] === 0) {
|
|
122
|
+
throw Error("n-th coeff must be not null");
|
|
120
123
|
}
|
|
121
124
|
this.coefficients = coefficients;
|
|
122
125
|
this.variable = variable;
|
|
123
126
|
this.degree = coefficients.length - 1;
|
|
124
127
|
}
|
|
125
128
|
equals(P) {
|
|
126
|
-
return P.degree === this.degree &&
|
|
129
|
+
return (P.degree === this.degree &&
|
|
130
|
+
this.coefficients.every((coeff, i) => coeff === P.coefficients[i]));
|
|
127
131
|
}
|
|
128
132
|
getRoots() {
|
|
129
133
|
const roots = [];
|
|
@@ -154,11 +158,14 @@ class Polynomial {
|
|
|
154
158
|
}
|
|
155
159
|
else {
|
|
156
160
|
//méthode de Newton-Raphson ou des bibliothèques de calcul symbolique pour obtenir les racines.
|
|
157
|
-
throw Error(
|
|
161
|
+
throw Error("general roots not implemented yet");
|
|
158
162
|
}
|
|
159
163
|
return roots.sort((a, b) => a - b);
|
|
160
164
|
}
|
|
161
165
|
add(P) {
|
|
166
|
+
if (typeof P === "number") {
|
|
167
|
+
return new Polynomial([this.coefficients[0] + P, ...this.coefficients.slice(1)], this.variable);
|
|
168
|
+
}
|
|
162
169
|
if (P.variable !== this.variable)
|
|
163
170
|
throw Error("Can't add two polynomials with different variables");
|
|
164
171
|
const maxDegree = Math.max(P.degree, this.degree);
|
|
@@ -203,19 +210,50 @@ class Polynomial {
|
|
|
203
210
|
}
|
|
204
211
|
return new Polynomial(res.slice(0, firstNonZeroIndex), this.variable);
|
|
205
212
|
}
|
|
213
|
+
scalarDivide(n) {
|
|
214
|
+
return new Polynomial(this.coefficients.map((coeff) => coeff / n), this.variable);
|
|
215
|
+
}
|
|
206
216
|
opposite() {
|
|
207
217
|
return new Polynomial(this.coefficients.map((coeff) => -coeff), this.variable);
|
|
208
218
|
}
|
|
209
219
|
derivate() {
|
|
220
|
+
if (this.coefficients.length === 1)
|
|
221
|
+
return new Polynomial([0], this.variable);
|
|
210
222
|
const res = [];
|
|
211
223
|
for (let i = 1; i < this.coefficients.length; i++)
|
|
212
224
|
res.push(i * this.coefficients[i]);
|
|
213
225
|
return new Polynomial(res, this.variable);
|
|
214
226
|
}
|
|
215
|
-
integrate() {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
227
|
+
// integrate(): Polynomial {
|
|
228
|
+
// const newCoefficients = this.coefficients.map(
|
|
229
|
+
// (coeff, exp) => coeff / (exp + 1),
|
|
230
|
+
// );
|
|
231
|
+
// newCoefficients.unshift(0);
|
|
232
|
+
// return new Polynomial(newCoefficients, this.variable);
|
|
233
|
+
// }
|
|
234
|
+
integrateToNode(opts) {
|
|
235
|
+
let integralPolynomial = new variableNode_1.VariableNode("C");
|
|
236
|
+
for (let i = 0; i < this.degree + 1; i++) {
|
|
237
|
+
const coeff = this.coefficients[i];
|
|
238
|
+
if (coeff === 0)
|
|
239
|
+
continue;
|
|
240
|
+
const nodeCoeff = new rational_1.Rational(coeff, i + 1).simplify().toTree();
|
|
241
|
+
const powerNode = i + 1 === 1
|
|
242
|
+
? new variableNode_1.VariableNode("x")
|
|
243
|
+
: new powerNode_1.PowerNode(new variableNode_1.VariableNode("x"), new numberNode_1.NumberNode(i + 1), opts);
|
|
244
|
+
let terme;
|
|
245
|
+
if (nodeCoeff.toTex() === "1")
|
|
246
|
+
terme = powerNode;
|
|
247
|
+
else if (nodeCoeff.toTex() === "-1")
|
|
248
|
+
terme = new oppositeNode_1.OppositeNode(powerNode, opts);
|
|
249
|
+
else {
|
|
250
|
+
terme = new multiplyNode_1.MultiplyNode(nodeCoeff, i + 1 === 1
|
|
251
|
+
? new variableNode_1.VariableNode("x")
|
|
252
|
+
: new powerNode_1.PowerNode(new variableNode_1.VariableNode("x"), new numberNode_1.NumberNode(i + 1), opts), opts);
|
|
253
|
+
}
|
|
254
|
+
integralPolynomial = new addNode_1.AddNode(terme, integralPolynomial, opts);
|
|
255
|
+
}
|
|
256
|
+
return integralPolynomial;
|
|
219
257
|
}
|
|
220
258
|
calculate(x) {
|
|
221
259
|
let res = 0;
|
|
@@ -226,26 +264,48 @@ class Polynomial {
|
|
|
226
264
|
getLimit(to) {
|
|
227
265
|
const leadingCoeff = this.coefficients[this.coefficients.length - 1];
|
|
228
266
|
if (this.degree === 0)
|
|
229
|
-
return leadingCoeff +
|
|
230
|
-
if (to ===
|
|
267
|
+
return leadingCoeff + "";
|
|
268
|
+
if (to === "+\\infty") {
|
|
269
|
+
if (leadingCoeff > 0)
|
|
270
|
+
return "+\\infty";
|
|
271
|
+
return "-\\infty";
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
if (leadingCoeff > 0) {
|
|
275
|
+
if (this.degree % 2 === 0)
|
|
276
|
+
return "+\\infty";
|
|
277
|
+
return "-\\infty";
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
if (this.degree % 2 === 0)
|
|
281
|
+
return "-\\infty";
|
|
282
|
+
return "+\\infty";
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
getLimitNode(to) {
|
|
287
|
+
const leadingCoeff = this.coefficients[this.coefficients.length - 1];
|
|
288
|
+
if (this.degree === 0)
|
|
289
|
+
return new numberNode_1.NumberNode(leadingCoeff);
|
|
290
|
+
if (to === "+\\infty") {
|
|
231
291
|
if (leadingCoeff > 0)
|
|
232
|
-
return
|
|
233
|
-
return
|
|
292
|
+
return infiniteNode_1.PlusInfinityNode;
|
|
293
|
+
return infiniteNode_1.MinusInfinityNode;
|
|
234
294
|
}
|
|
235
295
|
else {
|
|
236
296
|
if (leadingCoeff > 0) {
|
|
237
297
|
if (this.degree % 2 === 0)
|
|
238
|
-
return
|
|
239
|
-
return
|
|
298
|
+
return infiniteNode_1.PlusInfinityNode;
|
|
299
|
+
return infiniteNode_1.MinusInfinityNode;
|
|
240
300
|
}
|
|
241
301
|
else {
|
|
242
302
|
if (this.degree % 2 === 0)
|
|
243
|
-
return
|
|
244
|
-
return
|
|
303
|
+
return infiniteNode_1.MinusInfinityNode;
|
|
304
|
+
return infiniteNode_1.PlusInfinityNode;
|
|
245
305
|
}
|
|
246
306
|
}
|
|
247
307
|
}
|
|
248
|
-
toTree() {
|
|
308
|
+
toTree(opts) {
|
|
249
309
|
const recursive = (cursor) => {
|
|
250
310
|
const coeff = this.coefficients[cursor];
|
|
251
311
|
if (coeff === 0)
|
|
@@ -254,7 +314,7 @@ class Polynomial {
|
|
|
254
314
|
return new numberNode_1.NumberNode(coeff);
|
|
255
315
|
}
|
|
256
316
|
const monome = cursor > 1
|
|
257
|
-
? new powerNode_1.PowerNode(new variableNode_1.VariableNode(this.variable), new numberNode_1.NumberNode(cursor))
|
|
317
|
+
? new powerNode_1.PowerNode(new variableNode_1.VariableNode(this.variable), new numberNode_1.NumberNode(cursor), opts)
|
|
258
318
|
: new variableNode_1.VariableNode(this.variable);
|
|
259
319
|
let res;
|
|
260
320
|
if (coeff === 1)
|
|
@@ -262,7 +322,7 @@ class Polynomial {
|
|
|
262
322
|
else if (coeff === -1)
|
|
263
323
|
res = new oppositeNode_1.OppositeNode(monome);
|
|
264
324
|
else
|
|
265
|
-
res = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(coeff), monome);
|
|
325
|
+
res = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(coeff), monome, opts);
|
|
266
326
|
let nextCoeff;
|
|
267
327
|
for (let i = cursor - 1; i > -1; i--) {
|
|
268
328
|
if (this.coefficients[i]) {
|
|
@@ -280,7 +340,7 @@ class Polynomial {
|
|
|
280
340
|
return recursive(this.degree);
|
|
281
341
|
}
|
|
282
342
|
toTex() {
|
|
283
|
-
let s =
|
|
343
|
+
let s = "";
|
|
284
344
|
for (let i = this.degree; i > -1; i--) {
|
|
285
345
|
const coeff = this.coefficients[i];
|
|
286
346
|
if (coeff === 0)
|
|
@@ -288,10 +348,17 @@ class Polynomial {
|
|
|
288
348
|
if (i === 0)
|
|
289
349
|
s += coeff > 0 ? `+${coeff}` : coeff;
|
|
290
350
|
else if (i === this.degree) {
|
|
291
|
-
s += coeff === 1 ?
|
|
351
|
+
s += coeff === 1 ? "" : coeff === -1 ? "-" : coeff;
|
|
292
352
|
}
|
|
293
353
|
else {
|
|
294
|
-
s +=
|
|
354
|
+
s +=
|
|
355
|
+
coeff === 1
|
|
356
|
+
? "+"
|
|
357
|
+
: coeff === -1
|
|
358
|
+
? "-"
|
|
359
|
+
: coeff > 0
|
|
360
|
+
? `+${coeff}`
|
|
361
|
+
: coeff;
|
|
295
362
|
}
|
|
296
363
|
//x^n
|
|
297
364
|
if (i === 0)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FractionNode } from "../../tree/nodes/operators/fractionNode";
|
|
2
|
+
import { Polynomial } from "./polynomial";
|
|
3
|
+
import { Rational } from "../numbers/rationals/rational";
|
|
4
|
+
import { Integer } from "../numbers/integer/integer";
|
|
5
|
+
export declare class RationalFrac {
|
|
6
|
+
num: Polynomial;
|
|
7
|
+
denum: Polynomial;
|
|
8
|
+
constructor(num: Polynomial, denum: Polynomial);
|
|
9
|
+
toTree(): FractionNode;
|
|
10
|
+
simplify(): Integer | Rational | RationalFrac;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=rationalFrac.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rationalFrac.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/rationalFrac.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,qBAAa,YAAY;IACvB,GAAG,EAAE,UAAU,CAAC;IAChB,KAAK,EAAE,UAAU,CAAC;gBACN,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU;IAI9C,MAAM;IAGN,QAAQ;CAuCT"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RationalFrac = void 0;
|
|
4
|
+
const fractionNode_1 = require("../../tree/nodes/operators/fractionNode");
|
|
5
|
+
const mathjs_1 = require("mathjs");
|
|
6
|
+
const rational_1 = require("../numbers/rationals/rational");
|
|
7
|
+
const nombre_1 = require("../numbers/nombre");
|
|
8
|
+
const integer_1 = require("../numbers/integer/integer");
|
|
9
|
+
class RationalFrac {
|
|
10
|
+
constructor(num, denum) {
|
|
11
|
+
this.num = num;
|
|
12
|
+
this.denum = denum;
|
|
13
|
+
}
|
|
14
|
+
toTree() {
|
|
15
|
+
return new fractionNode_1.FractionNode(this.num.toTree(), this.denum.toTree());
|
|
16
|
+
}
|
|
17
|
+
simplify() {
|
|
18
|
+
if (this.num.coefficients.length === 1 && this.num.coefficients[0] === 0)
|
|
19
|
+
return new integer_1.Integer(0);
|
|
20
|
+
const numCoeffs = this.num.coefficients.filter((c) => c !== 0);
|
|
21
|
+
const numPGCD = numCoeffs.length > 1 ? (0, mathjs_1.gcd)(...numCoeffs) : numCoeffs[0];
|
|
22
|
+
const denumCoeffs = this.denum.coefficients.filter((c) => c !== 0);
|
|
23
|
+
const denumPGCD = denumCoeffs.length > 1 ? (0, mathjs_1.gcd)(...denumCoeffs) : denumCoeffs[0];
|
|
24
|
+
const rational = new rational_1.Rational(numPGCD, denumPGCD);
|
|
25
|
+
if (rational.isIrreductible()) {
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
const simplifiedRational = rational.simplify();
|
|
29
|
+
const simplifiedNum = this.num.scalarDivide(numPGCD);
|
|
30
|
+
const simplifiedDenum = this.denum.scalarDivide(denumPGCD);
|
|
31
|
+
if (simplifiedDenum.equals(simplifiedNum)) {
|
|
32
|
+
return simplifiedRational;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
const denumHasOnlyMinus = simplifiedDenum.coefficients.every((coeff) => coeff <= 0);
|
|
36
|
+
const trueDenum = denumHasOnlyMinus
|
|
37
|
+
? simplifiedDenum.times(-1)
|
|
38
|
+
: simplifiedDenum;
|
|
39
|
+
if (simplifiedRational.type === nombre_1.NumberType.Integer) {
|
|
40
|
+
const int = simplifiedRational;
|
|
41
|
+
return new RationalFrac(simplifiedNum.times(int.value * (denumHasOnlyMinus ? -1 : 1)), trueDenum);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
const frac = simplifiedRational;
|
|
45
|
+
return new RationalFrac(simplifiedNum.times(frac.num * (denumHasOnlyMinus ? -1 : 1)), trueDenum.times(frac.denum));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.RationalFrac = RationalFrac;
|