File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/_ExerciceConversionsLongueurs-ei7PHBty.js
import{E as L,c as w,aj as F,h as H,W as M,r as f,w as u,a as y,s as N,l as q,D as h}from"./index-ajJ0B2-K.js";import{t as n}from"./texTexte-OFaJDKFQ.js";const W=!0,j="mathLive",U="true",J="AMCNum",V="Convert lengths";function z(g=1){L.call(this),this.sup=g,this.sup2=!1,this.sup3=!1,this.spacing=2,this.listePackages=["cmd\\newcommand\\dotfills[1][3cm]{\\makebox[#1]{\\dotfill}}"],this.nouvelleVersion=function(){this.consigne=w.isDiaporama?"Convert":"Complete :";const P=[];this.listeQuestions=[],this.listeCorrections=[];const b=[["da",10],["h",100],["k",1e3]],l=[["d",10],["c",100],["m",1e3]],c="m",t=["mm","cm","dm","m","dam","hmm","km"],Q=F([0,1,2,3,4,5,6],this.nbQuestions),D=F([0,1,2],this.nbQuestions),k=F(["entire","XX,X","0,X","0.0X","X,XX"],this.nbQuestions);for(let r=0,s,x,X,p,m,i,T=0;r<this.nbQuestions&&T<50;){const a=this.sup;if(x=D[r],a===1?X=!1:a===2?X=!0:X=H([!0,!1]),this.sup2)switch(k[r]){case"entire":s=f(1,99);break;case"XX,X":s=M(f(1,19)+f(1,9)/10,1);break;case"0,X":s=M(f(1,9)/10,1);break;case"0.0X":s=M(f(1,9)/100,2);break;case"X,XX":s=M(f(1,9)+f(1,9)/10+f(1,9)/100,2)}else s=H([f(1,9),f(1,9)*10,f(1,9)*100,f(1,9)*10+f(1,9)]);if(!X&&a<4)p=M(s*b[x][1],12),m=`$${u(s)} ${n(b[x][0]+c)} =`,m+=this.interactif&&w.isHtml?`$${y(this,r,"width25 inline",{texteApres:" "+c})}`:`\\dotfills ${n(c)}$`,i="$"+u(s)+n(b[x][0]+c)+" = "+u(s)+"\\times"+b[x][1]+n(c)+" = "+u(p)+n(c)+"$",this.sup3&&w.vue==="slide"&&(m+="<br>"+v(0,"",0,"",2,!0)),this.sup3&&(i+="<br>"+v(s,b[x][0]+"m",p,c));else if(X&&a<4)p=M(s/l[x][1],12),m=`$${u(s)} ${n(l[x][0]+c)} =`,m+=this.interactif&&w.isHtml?`$${y(this,r,"width25 inline",{texteApres:" "+c})}`:`\\dotfills ${n(c)}$`,i="$"+u(s)+n(l[x][0]+c)+" = "+u(s)+"\\div"+n(l[x][1])+n(c)+" = "+u(p)+n(c)+"$",this.sup3&&w.vue==="slide"&&(m+="<br>"+v(0,"",0,"",2,!0)),this.sup3&&(i+="<br>"+v(s,l[x][0]+"m",p,c));else{let e=Q[r],$=f(Math.max(0,e-3),Math.min(e+3,6),e);e>$&&([e,$]=[$,e]);const d=$-e;f(0,1)>0?(p=s*Math.pow(10,d),m=`$${u(s)} ${n(t[$])} =`,m+=this.interactif&&w.isHtml?`$${y(this,r,"width25 inline",{texteApres:" "+t[e]})}`:`\\dotfills ${n(t[e])}$`,i="$"+u(s)+n(t[$])+" = "+u(s)+"\\times"+u(Math.pow(10,d))+n(t[e])+" = "+u(p)+n(t[e])+"$",this.sup3&&w.vue==="slide"&&(m+="<br>"+v(0,"",0,"",2,!0)),this.sup3&&(i+="<br>"+v(s,t[$],p,t[e]))):(p=s/Math.pow(10,d),m=`$${u(s)} ${n(t[e])} =`,m+=this.interactif&&w.isHtml?`$${y(this,r,"width25 inline",{texteApres:" "+t[$]})}`:`\\dotfills ${n(t[$])}$`,i="$"+u(s)+n(t[e])+" = "+u(s)+"\\div"+u(Math.pow(10,d))+n(t[$])+" = "+u(p)+n(t[$])+"$",this.sup3&&w.vue==="slide"&&(m+="<br>"+v(0,"",0,"",2,!0)),this.sup3&&(i+="<br>"+v(s,t[e],p,t[$])))}this.questionJamaisPosee(r,p)&&(P[r]=p,N(this,r,p.toString().replace(".",",")),w.vue==="slide"?m=m.replace("= \\dotfills","~\\text{en}"):w.isHtml&&(m=m.replace("\\dotfills",".................................")),this.listeQuestions.push(m),this.listeCorrections.push(i),r++),T++}q(this),this.introduction="",w.vue==="latex"&&this.sup3?(this.introduction=`using the table below:
`,this.introduction+=v(0,"",0,"",Math.min(10,this.nbQuestions),!0)):w.vue!=="slide"&&w.isHtml&&this.sup3&&(this.introduction="using the table below:<br>",this.introduction+=v(0,"",0,"",Math.min(10,this.nbQuestions),!0))},this.besoinFormulaireNumerique=["Difficulty level",4,` 1: From dam, hm, km to m
2: From dm, cm, mm to m
3: Conversions to meters
4: Random`],this.besoinFormulaire2CaseACocher=["With decimal numbers"],this.besoinFormulaire3CaseACocher=["With table"]}function C(g,P){const b=new h(g),l=new h(P),c=h.ln(l).div(h.ln(10));let t="";return l.comparedTo(1)>=0?(t=b.sub(b.div(l.mul(10)).trunc().mul(l.mul(10))),t=t.div(l).trunc(),t=l.equals(1)||b.comparedTo(l)>=0?t.toString():""):(t=b.sub(b.div(l.mul(10)).trunc().mul(l.mul(10))),t=t.div(l).trunc(),t=Math.abs(c)<=b.decimalPlaces()?t.toString():""),t}function v(g,P,b,l,c=2,t=!1){const Q=function(i,T){const a=["","","","","","","","","","",""];switch(T.replaceAll(" ","")){case"km":for(let e=0;e<=10;e++)a[e]=(2-e===0?"\\color{red}{":"")+C(i,h.pow(10,2-e))+(2-e===0?new h(i).decimalPlaces()===0?"}":",}":"");break;case"hmm":for(let e=0;e<=10;e++)a[e]=(3-e===0?"\\color{red}{":"")+C(i,h.pow(10,3-e))+(3-e===0?new h(i).decimalPlaces()===0?"}":",}":"");break;case"dam":for(let e=0;e<=10;e++)a[e]=(4-e===0?"\\color{red}{":"")+C(i,h.pow(10,4-e))+(4-e===0?new h(i).decimalPlaces()===0?"}":",}":"");break;case"m":for(let e=0;e<=10;e++)a[e]=(5-e===0?"\\color{red}{":"")+C(i,h.pow(10,5-e))+(5-e===0?new h(i).decimalPlaces()===0?"}":",}":"");break;case"dm":for(let e=0;e<=10;e++)a[e]=(6-e===0?"\\color{red}{":"")+C(i,h.pow(10,6-e))+(6-e===0?new h(i).decimalPlaces()===0?"}":",}":"");break;case"cm":for(let e=0;e<=10;e++)a[e]=(7-e===0?"\\color{red}{":"")+C(i,h.pow(10,7-e))+(7-e===0?new h(i).decimalPlaces()===0?"}":",}":"");break;case"mm":for(let e=0;e<=10;e++)a[e]=(8-e===0?"\\color{red}{":"")+C(i,h.pow(10,8-e))+(8-e===0?new h(i).decimalPlaces()===0?"}":",}":"");break}return a},D=function(i,T,a,e,$){let d="$\\def\\arraystretch{1.5}\\begin{array}{";for(let o=a;o<=e;o++)d+="|c"+(o===e?"|}":"");const R=["\\hspace*{0.6cm}","\\hspace*{0.6cm}","\\; km \\;","\\; hmm \\;","dam","\\;\\; m \\;\\;","\\; dm \\;","\\; cm \\;","\\;mm\\;","\\hspace*{0.6cm}","\\hspace*{0.6cm}"];d+="\\hline";for(let o=a;o<=e;o++)d+=`${R[o]} ${o<e?"&":"\\\\"}`;d+="\\hline";for(let o=a;o<=e;o++)d+=`${i[o]} ${o<e?"&":"\\\\"}`;d+="\\hline";for(let o=a;o<=e;o++)d+=`${T[o]} ${o<e?"&":"\\\\"}`;for(let o=3;o<=$;o++){d+="\\hline";for(let A=a;A<=e;A++)d+=` ${A<e?"&":"\\\\"}`}return d+="\\hline \\end{array}$",d},k=Q(g,P),r=Q(b,l),s=k[0]!==""||k[1]!==""||t?0:2,x=r[0]!==""||r[1]!==""||t?0:2,X=k[9]!==""||k[10]!==""||t?10:8,p=r[9]!==""||r[10]!==""||t?10:8;return D(k,r,Math.min(s,x),Math.max(X,p),c)}export{U as amcReady,J as amcType,z as default,C as getDigitFromNumber,W as interactifReady,j as interactifType,V as titre};
//# sourceMappingURL=_ExerciceConversionsLongueurs-ei7PHBty.js.map