PBYetml / POBJ_SLO2_PRJ_CPP

Resultat Projet Etudiants
HomePage
0 stars 2 forks source link

GSM -> FonctionBinaire.cpp -> remarques/bugs -> méthode InsererValeur #19

Open PBYetml opened 1 year ago

PBYetml commented 1 year ago

voir fichier listant les différentes vidéos retour vidéo

Gajamukan commented 1 year ago

-Limite inséree value limitMaxValue = pow (2, nbDigit) -1; //pow = 2 à la puissance au nb de digit ensuite il faut faire -1 comme ça commence à de 0 -récupération de la valeur insérée std::cin >> entreeA ; std::cin >> entreeB ;

//Passer en valeur absolue entreeA = abs(entreeA); entreeB = abs(entreeB);

//-- test sur la valeur --// 
if (entreeA >  limitMaxValue)
{
    entreeA =  limitMaxValue;
}
if (entreeA < 0)
{
    entreeA = entreeA * (-1);
}
if (entreeA == 0)
{
    entreeA = 1;
}
    //La même chose pour l'entrée B