abc/src/bdd/cudd/cuddApa.c
/**Function********************************************************************

  Synopsis    [Subtracts two arbitrary precision integers.]

  Description [Subtracts two arbitrary precision integers.  Returns the
  borrow out of the most significant digit.]

  SideEffects [The result of the subtraction is stored in parameter
  <code>diff</code>.]

  SeeAlso     []

******************************************************************************/
Function
Synopsis    [Subtracts two arbitrary precision integers.]

Description [Subtracts two arbitrary precision integers.  Returns the
borrow out of the most significant digit.]

SideEffects [The result of the subtraction is stored in parameter
diff.]


Function Synopsis [ Subtracts two arbitrary precision integers . ] Description [ Subtracts two arbitrary precision integers . Returns the borrow out of the most significant digit . ] SideEffects [ The result of the subtraction is stored in parameter diff . ]
DdApaDigit
Cudd_ApaSubtract(
  int  digits,
  DdApaNumber  a,
  DdApaNumber  b,
  DdApaNumber  diff)
{
    int i;
    DdApaDoubleDigit partial = DD_APA_BASE;
    for (i = digits - 1; i >= 0; i--) {
        partial = DD_MSDIGIT(partial) + DD_APA_MASK + a[i] - b[i];
        diff[i] = (DdApaDigit) DD_LSDIGIT(partial);
    }
    return((DdApaDigit) DD_MSDIGIT(partial) - 1);
}
DdApaDigit Cudd_ApaSubtract ( int digits , DdApaNumber a , DdApaNumber b , DdApaNumber diff ) { int i ; DdApaDoubleDigit partial = DD_APA_BASE ; for ( i = digits - 1 ; i >= 0 ; i -- ) { partial = DD_MSDIGIT ( partial ) + DD_APA_MASK + a [ i ] - b [ i ] ; diff [ i ] = ( DdApaDigit ) DD_LSDIGIT ( partial ) ; } return ( ( DdApaDigit ) DD_MSDIGIT ( partial ) - 1 ) ; }
Function
Synopsis    [Subtracts two arbitrary precision integers.]
Function Synopsis [ Subtracts two arbitrary precision integers . ]