/**************************************************************************/
/*                                                                        */
/*                                 Sources                                */
/*                                from  the                               */
/*                           XSC SOFTWARE PACKAGE                         */
/*                                                                        */
/*                Copyright (c) 1997 University of Karlsruhe              */
/*                     Institute for Appl. Mathematics                    */
/*                                                                        */
/* This program is free software for non-commercial use. For details, see */
/* the file LICENSE.XSC, distributed with this software package.          */
/*                                                                        */
/* This program is distributed WITHOUT ANY WARRANTY. For details, see the */
/* file LICENSE.XSC, distributed with this software package.              */
/*                                                                        */
/**************************************************************************/

/* RCS $Id: b_bcmp.c,v 1.2 1997/09/25 16:57:38 ae59 Exp $ */
/*
$Log: b_bcmp.c,v $
 * Revision 1.2  1997/09/25  16:57:38  ae59
 * Copyright-message
 *
 * Revision 1.1  1994/01/27  13:21:05  ae59
 * Put under RCS control
 *
 */
/************************************************************************/
/*                                                                      */
/* Descriptive Name : b_bcmp.c          Processor : C                   */
/*                                                                      */
/* Compare numbers in intern representation                             */
/*                                                                      */
/* Function value : int     0 - numbers are equal                       */
/*                         -1 - first number less than second number    */
/*                          1 - first number greater than second number */
/*                                                                      */
/* Function references : b_bacm - compare positive numbers              */
/*                                                                      */
/*      Date            : 1990-07-16                                    */
/*      1990-07-16 : LINT_ARGS prototype                                */
/************************************************************************/

#ifndef ALL_IN_ONE
#ifdef AIX
#include "/u/p88c/runtime/o_defs.h"
#else
#include "o_defs.h"
#endif
#define local
#endif

#ifdef LINT_ARGS
local int b_bcmp(multiprecision i1,multiprecision i2)
#else
local int b_bcmp(i1,i2)

multiprecision i1;
multiprecision i2;   /* pointer to intern variables                  */
#endif
        {
        if (i1->z)
           {
           if (i2->z) return(0);
           else return((int)(2*i2->s-1));
           }
        if (i2->z || i1->s!=i2->s) return((int)(1-2*i1->s));
        return((int)(1-2*i1->s)*b_bacm(i1,i2));
        }
