Code pour vérifier la deuxième méthode de multiplication de deux nombres entiers
DIASOLUKA Nz. Luyalu - 2 / 8 - vendredi 31 mai 2019 [5:51:53 PM]
Voici un petit code de programme qui permet de faire la vérification de
ce principe avec plusieurs nombres :
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1252" />
<base target="_top">
<title>Méthode alternative de multiplication de deux nombres</title>
<meta content="30 days" name=Revisit-after>
<meta name=ROBOTS content="INDEX,FOLLOW">
<meta http-equiv=Page-Enter
content="RevealTrans(Duration=3,Transition=23)">
<meta http-equiv=Page-Exit
content="RevealTrans(Duration=3,Transition=23)">
<meta http-equiv=Content-Language content=fr-be>
<meta name=Title
content="Méthode alternative de multiplication de deux
nombres|Mathématique">
<meta name=Created content="jeudi 18 avril 2019, 23:09:26">
<meta name=Modified content="mardidi 28 avril 2019 - 15:34:32">
<meta name=description
content="Méthode alternative de multiplication de deux nombres">
<meta name=keywords content="méthode,multiplication,nombres">
<meta name="author"
content="Dr. Jean-Baptiste Dadet DIASOLUKA Nzoyifuanga Luyalu
(CNOM : 0866) - Ophtalmologiste">
<meta name="author-site"
content="http://www.blogg.org/blog-57394.html">
<meta name="author-site2"
content="http://www.amessi.org/diasoluka">
<meta name="author-site3"
content="https://www.vk.com/diasoluyalu">
<script type = "text/javascript"> "use strict";
const a = Math.round((Math.random()*100000)),
b = Math.round((Math.random()*100000));
let c=0 ,
tmp="\n"+ ++c+". *** a = "+a+
"\n"+ ++c+". *** b = "+b+"\n";
let aU = a % 10, bU = b % 10;
tmp+="\n"+ ++c+". aU [a % 10 = "+a+" % 10] = "+aU +
"\n"+ ++c+". bU [b % 10 = "+b+" % 10] = "+bU+"\n";
let aD = parseInt(a/10), bD = parseInt(b/10);
tmp+="\n"+ ++c+". aD [parseInt(a/10)] = "+aD +
"\n"+ ++c+". bD [parseInt(b/10)] = "+bD+"\n";
let mG = aD * bD, mD = aU * bU;
tmp+="\n"+ ++c+". mG (ad ["+aD+"] * bD ["+bD+"]) = "+mG +
"\n"+ ++c+". mD (aU ["+aU+"] * bU ["+bU+"]) = "+mD+"\n";
let mI = aU * bD;
tmp+="\n"+ ++c+". mI = { aU [="+a+" % 10 = "+aU+"] * "+
"bD [= parseInt("+b+"/"+10+")= "+bD+"] } = "+mI+"\n";