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

  Synopsis    [Divides an arbitrary precision integer by a digit.]

  Description [Divides an arbitrary precision integer by a digit.]

  SideEffects [The quotient is returned in parameter <code>quotient</code>.]

  SeeAlso     []

******************************************************************************/
Function
Synopsis    [Divides an arbitrary precision integer by a digit.]

Description [Divides an arbitrary precision integer by a digit.]

SideEffects [The quotient is returned in parameter quotient.]


Function Synopsis [ Divides an arbitrary precision integer by a digit . ] Description [ Divides an arbitrary precision integer by a digit . ] SideEffects [ The quotient is returned in parameter quotient . ]
DdApaDigit
Cudd_ApaShortDivision(
  int  digits,
  DdApaNumber  dividend,
  DdApaDigit  divisor,
  DdApaNumber  quotient)
{
    int i;
    DdApaDigit remainder;
    DdApaDoubleDigit partial;
    remainder = 0;
    for (i = 0; i < digits; i++) {
        partial = remainder * DD_APA_BASE + dividend[i];
        quotient[i] = (DdApaDigit) (partial/(DdApaDoubleDigit)divisor);
        remainder = (DdApaDigit) (partial % divisor);
    }
    return(remainder);
}
DdApaDigit Cudd_ApaShortDivision ( int digits , DdApaNumber dividend , DdApaDigit divisor , DdApaNumber quotient ) { int i ; DdApaDigit remainder ; DdApaDoubleDigit partial ; remainder = 0 ; for ( i = 0 ; i < digits ; i ++ ) { partial = remainder * DD_APA_BASE + dividend [ i ] ; quotient [ i ] = ( DdApaDigit ) ( partial / ( DdApaDoubleDigit ) divisor ) ; remainder = ( DdApaDigit ) ( partial % divisor ) ; } return ( remainder ) ; }
Function
Synopsis    [Divides an arbitrary precision integer by a digit.]
Function Synopsis [ Divides an arbitrary precision integer by a digit . ]