Entier
Commande de compilation
javac -g -classpath ${UPS_HOME}/upsjav/upsjav/french/upsvtm.jar entier.java
Commande d'exécution
java -classpath ${UPS_HOME}/upsjav/upsjav/french/upsvtm.jar;. -Djava.library.path=${UPS_HOME}/upsvtm/bin;${UPS_HOME}/upsnet/bin;${UPS_HOME}/upscmp/bin;${UPS_HOME}/upscom/bin;${UPS_HOME}/upscrb/bin;${UPS_HOME}/upsjav/bin;${UPS_HOME}/upsjav/bin/french entier
Fichier source
import UpsKrn.Caractere;
import UpsKrn.Entier;
import UpsKrn.MUpsKrn;
import UpsKrn.UpsException;
public class entier
/******************/
{
public static void main(String s[])
/*********************************/
{
Entier A;
int B;
try
{
if (!MUpsKrn.Demarrer())
A=MUpsKrn.JavaInt2Entier(1);
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=1;
System.out.println(B);
A=A.Additionner(MUpsKrn.JavaInt2Entier(1));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=B+1;
System.out.println(B);
A=A.Soustraire2(MUpsKrn.JavaInt2Entier(10));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=B-10;
System.out.println(B);
A=A.Multiplier(MUpsKrn.JavaInt2Entier(10));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=B*10;
System.out.println(B);
A=A.DiviserEntier(MUpsKrn.JavaInt2Entier(5));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=(int)(B/5);
System.out.println(B);
A=A.Moduler(MUpsKrn.JavaInt2Entier(3));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=B%3;
System.out.println(B);
A=A.Puissance(MUpsKrn.JavaInt2Entier(3));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=(int)Math.pow((double)B,(double)3);
System.out.println(B);
A=A.EtBit(MUpsKrn.JavaInt2Entier(255));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=B&255;
System.out.println(B);
A=A.OuBit(MUpsKrn.JavaInt2Entier(256));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=B|256;
System.out.println(B);
A=A.SuperieurSuperieur(MUpsKrn.JavaInt2Entier(4));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=B>>4;
System.out.println(B);
A=A.InferieurInferieur(MUpsKrn.JavaInt2Entier(2));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=B<<2;
System.out.println(B);
A=MUpsKrn.JavaInt2Entier(1);
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=1;
System.out.println(B);
A.AdditionnerAffecter(MUpsKrn.JavaInt2Entier(1));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B+=1;
System.out.println(B);
A.SoustraireAffecter(MUpsKrn.JavaInt2Entier(10));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B-=10;
System.out.println(B);
A.MultiplierAffecter(MUpsKrn.JavaInt2Entier(10));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B*=10;
System.out.println(B);
A.DiviserEntierAffecter(MUpsKrn.JavaInt2Entier(5));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=(int)(B/5);
System.out.println(B);
A.ModulerAffecter(MUpsKrn.JavaInt2Entier(3));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B%=3;
System.out.println(B);
A.PuissanceAffecter(MUpsKrn.JavaInt2Entier(3));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B=(int)Math.pow((double)B,(double)3);
System.out.println(B);
A.EtBitAffecter(MUpsKrn.JavaInt2Entier(255));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B&=255;
System.out.println(B);
A.OuBitAffecter(MUpsKrn.JavaInt2Entier(256));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B|=256;
System.out.println(B);
A.SuperieurSuperieurAffecter(MUpsKrn.JavaInt2Entier(4));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B>>=4;
System.out.println(B);
A.InferieurInferieurAffecter(MUpsKrn.JavaInt2Entier(2));
System.out.println(MUpsKrn.Entier2JavaInt(A));
B<<=2;
System.out.println(B);
A.Incrementer(false);
System.out.println(MUpsKrn.Entier2JavaInt(A));
B++;
System.out.println(B);
A.Decrementer(false);
System.out.println(MUpsKrn.Entier2JavaInt(A));
B--;
System.out.println(B);
A.Incrementer(true);
System.out.println(MUpsKrn.Entier2JavaInt(A));
++B;
System.out.println(B);
A.Decrementer(true);
System.out.println(MUpsKrn.Entier2JavaInt(A));
--B;
System.out.println(B);
if (MUpsKrn.Booleen2JavaBoolean(A.Egal(MUpsKrn.JavaInt2Entier(1))))
System.out.println("A==1");
if (MUpsKrn.Booleen2JavaBoolean(A.Different(MUpsKrn.JavaInt2Entier(1))))
System.out.println("A!=1");
if (MUpsKrn.Booleen2JavaBoolean(A.InferieurOuEgal(MUpsKrn.JavaInt2Entier(1))))
System.out.println("A<=1");
if (MUpsKrn.Booleen2JavaBoolean(A.SuperieurOuEgal(MUpsKrn.JavaInt2Entier(1))))
System.out.println("A>=1");
if (MUpsKrn.Booleen2JavaBoolean(A.Inferieur(MUpsKrn.JavaInt2Entier(1))))
System.out.println(A<1");
if (MUpsKrn.Booleen2JavaBoolean(A.Superieur(MUpsKrn.JavaInt2Entier(1))))
System.out.println("A>1");
if (B==1)
System.out.println("B==1");
if (B!=1)
System.out.println("B!=1");
if (B<=1)
System.out.println("B<=1");
if (B>=1)
System.out.println("B>=1");
if (B&tl;1)
System.out.println("B<1");
if (B>1)
System.out.println("B>1");
MUpsKrn.Arreter();
}
catch (java.lang.Throwable e)
{
try
{
System.out.println("Erreur UpsKrn-0 : L'exception suivante a été envoyée dans le source '"
+e.NomSourceEnErreur+"' ligne "+e.NumeroLigne+", colonne "+e.NumeroColonne+" :");
System.out.println(e.MessageErreur);
}
catch (java.lang.Throwable e2)
{
System.out.println(e2.toString());
}
}
}
}