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

  Synopsis    [Sets an arbitrary precision integer to a power of two.]

  Description [Sets an arbitrary precision integer to a power of
  two. If the power of two is too large to be represented, the number
  is set to 0.]

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

  SeeAlso     []

******************************************************************************/
Function
Synopsis    [Sets an arbitrary precision integer to a power of two.]

Description [Sets an arbitrary precision integer to a power of
two. If the power of two is too large to be represented, the number
is set to 0.]

SideEffects [The result is returned in parameter number.]


Function Synopsis [ Sets an arbitrary precision integer to a power of two . ] Description [ Sets an arbitrary precision integer to a power of two . If the power of two is too large to be represented the number is set to 0 . ] SideEffects [ The result is returned in parameter number . ]
void
Cudd_ApaPowerOfTwo(
  int  digits,
  DdApaNumber  number,
  int  power)
{
    int i;
    int index;
    for (i = 0; i < digits; i++)
        number[i] = 0;
    i = digits - 1 - power / DD_APA_BITS;
    if (i < 0) return;
    index = power & (DD_APA_BITS - 1);
    number[i] = 1 << index;
}
void Cudd_ApaPowerOfTwo ( int digits , DdApaNumber number , int power ) { int i ; int index ; for ( i = 0 ; i < digits ; i ++ ) number [ i ] = 0 ; i = digits - 1 - power / DD_APA_BITS ; if ( i < 0 ) return ; index = power & ( DD_APA_BITS - 1 ) ; number [ i ] = 1 << index ; }
Function
Synopsis    [Sets an arbitrary precision integer to a power of two.]
Function Synopsis [ Sets an arbitrary precision integer to a power of two . ]