--- rpl/src/instructions_a1.c 2013/02/26 19:56:13 1.41 +++ rpl/src/instructions_a1.c 2013/03/16 11:31:41 1.43 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.1.12 + RPL/2 (R) version 4.1.13 Copyright (C) 1989-2013 Dr. BERTRAND Joël This file is part of RPL/2. @@ -865,14 +865,28 @@ instruction_abs(struct_processus *s_etat if ((*s_objet_argument).type == INT) { - if ((s_objet_resultat = allocation(s_etat_processus, INT)) == NULL) + if ((*((integer8 *) (*s_objet_argument).objet)) != INT64_MIN) { - (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; - return; + if ((s_objet_resultat = allocation(s_etat_processus, INT)) == NULL) + { + (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + return; + } + + (*((integer8 *) (*s_objet_resultat).objet)) = abs((*((integer8 *) + (*s_objet_argument).objet))); } + else + { + if ((s_objet_resultat = allocation(s_etat_processus, REL)) == NULL) + { + (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + return; + } - (*((integer8 *) (*s_objet_resultat).objet)) = abs((*((integer8 *) - (*s_objet_argument).objet))); + (*((real8 *) (*s_objet_resultat).objet)) = abs((real8) + ((*((integer8 *) (*s_objet_argument).objet)))); + } } /*