Low Zero Limbs

LingWitt@insightbb.com LingWitt@insightbb.com
Sun, 22 Jun 2003 01:38:18 -0400


--Apple-Mail-2-643686937
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

What is a better way to do this?

unsigned int stripLowZeroLimbs(mpf_ptr f)
{
     int		sizeNew		= f->_mp_size;
     mp_limb_t*	limbs		= f->_mp_d;
     mp_limb_t*	limb		= 0;

     while (*(limb = limbs++) == 0 && sizeNew > 1)
     {
         //free(limb);
         sizeNew--;
     }

     f->_mp_size = sizeNew;

     return f->_mp_size - sizeNew;
}
--Apple-Mail-2-643686937
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
	charset=US-ASCII

<fixed><color><param>7676,0F0F,5050</param>What is a better way to do
this?


unsigned</color> int stripLowZeroLimbs(mpf_ptr f)

{

    <color><param>7676,0F0F,5050</param>int</color>		sizeNew		=
f->_mp_size;

    mp_limb_t*	limbs		= f->_mp_d;

    mp_limb_t*	limb		= <color><param>0000,0000,FFFF</param>0</color>;

    

    <color><param>7676,0F0F,5050</param>while</color> (*(limb =
limbs++) == <color><param>0000,0000,FFFF</param>0</color> && sizeNew >
<color><param>0000,0000,FFFF</param>1</color>)

    {

        <color><param>2323,6E6E,2525</param>//free(limb);</color>

        sizeNew--;

    }

    

    f->_mp_size = sizeNew;

    

    <color><param>7676,0F0F,5050</param>return</color> f->_mp_size -
sizeNew;

}</fixed>
--Apple-Mail-2-643686937--