OEF Exercise - Décomposer un décimal
Décomposer un décimal
GNU GPL
Numbers
- E6
- H1
décimal décimaux numération décomposer décomposition
Décomposer un décimal
La décomposition classique d'un nombre décimal en une somme de termes de la forme a x 10^n.
Une fois sur deux, l'exercice demande les termes en lettres : 3 milliers + …
\title{Décomposer un décimal}
\language{fr}
\range{-5..5}
\author{Odile Bénassy}
\email{obenassy@free.fr}
\license{GNU GPL}
\computeanswer{no}
\format{html}
\precision{10000}
\integer{exonum=random(1..2)}
\integer{a1 = random(1..9)}
\integer{a2 = random(0..9)}
\integer{a3 = random(0..9)}
\integer{a4 = random(0..9)}
\integer{a5 = random(0..9)}
\integer{a6 = random(1..9)}
\integer{a = \a1 * 100000 + \a2 * 10000 + \a3 * 1000 + \a4 * 100 + \a5 * 10 + \a6}
\integer{first=-9}
\integer{last=2}
\integer{exp = random(\first..\last)}
\real{x = \a * 10^\exp}
\matrix{base1 = 100000000, 10000000, 1000000, 100000, 10000, 1000, 100, 10, 1, 0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001, 0.0000001, 0.00000001, 0.000000001}
\matrix{base2 = cent millions, fois dix millions, million(s), cent mille, fois dix-mille, millier(s), centaine(s), dizaine(s), unité(s), dixième(s), centième(s), millième(s), dix-millième(s), cent-millième(s), millionnième(s), dix-millionnième(s), cent-millionnième(s)}
\if{\exonum=1}{\matrix{base=\base1}}{\matrix{base=\base2}}
\integer{decalage=4}
\text{b1 = item(\decalage-\exp, \base)}
\text{b2 = item(\decalage-\exp+1, \base)}
\text{b3 = item(\decalage-\exp+2, \base)}
\text{b4 = item(\decalage-\exp+3, \base)}
\text{b5 = item(\decalage-\exp+4, \base)}
\text{b6 = item(\decalage-\exp+5, \base)}
\statement{
<p>Décomposer le nombre décimal :
<p>
\if{\exonum=1}{
\x = \embed{reply 1,1} x \b1 + \embed{reply 2,1} x \b2 + \embed{reply 3,1} x
\b3 + \embed{reply 4,1} x \b4 + \embed{reply 5,1} x \b5 + \embed{reply 6,1} x \b6
}{
\x = \embed{reply 1,1} \b1 + \embed{reply 2,1} \b2 + \embed{reply 3,1} \b3 +
\embed{reply 4,1} \b4 + \embed{reply 5,1} \b5 + \embed{reply 6,1} \b6
}
}
\answer{}{\a1}{type=numeric}
\answer{}{\a2}{type=numeric}
\answer{}{\a3}{type=numeric}
\answer{}{\a4}{type=numeric}
\answer{}{\a5}{type=numeric}
\answer{}{\a6}{type=numeric}
2004-05-24 16:12:52
2005-02-18 06:27:42