Precision Concession

LingWitt@insightbb.com LingWitt@insightbb.com
Wed, 25 Jun 2003 08:39:00 -0400


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

How is this:

unsigned int stripLowZeroLimbs(mpf_ptr f)
{
     unsigned 	sizeNew, sizeOld;
     sizeNew = sizeOld = f->_mp_size;
     mp_ptr	limbs			= f->_mp_d;
     mp_ptr	limb			= 0;

     if (sizeNew == 0)
         return 0;

     while (*(limb = limbs++) == 0)
         sizeNew--;

     if (sizeNew == sizeOld)
         return 0;

     mpf_set_prec(f, sizeNew * sizeof(mp_ptr) * 8);

     return sizeOld - f->_mp_size;
}

On Tuesday, Jun 24, 2003, at 23:46 America/New_York, 
LingWitt@insightbb.com wrote:

> This is what you meant:
>
> unsigned int stripLowZeroLimbs(mpf_ptr f)
> {
>     unsigned 	sizeNew, sizeOld;
>     sizeNew = sizeOld = f->_mp_size;
>     mp_ptr	limbs			= f->_mp_d;
>     mp_ptr	limb			= 0;
>
>     while (*(limb = limbs++) == 0)
>         sizeNew--;
>
>     if (sizeNew == sizeOld)
>         return 0;
> 	
>     f->_mp_size = sizeNew;
>
>     mp_ptr newLimbs = f->_mp_d;
>     limbs--;
>     for (unsigned int index = 0; index < sizeNew; index++)
>         newLimbs[index] = *(limbs++);
>
>     return sizeOld - f->_mp_size;
> }
--Apple-Mail-2-928129661
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
	charset=US-ASCII

How is this:


<fixed><color><param>7670,0F09,504A</param>unsigned</color>
<color><param>7670,0F09,504A</param>int</color>
stripLowZeroLimbs(mpf_ptr f)</fixed>

<fixed>{

    <color><param>7676,0F0F,5050</param>unsigned</color> 	sizeNew,
sizeOld;

    sizeNew = sizeOld = f->_mp_size;

    mp_ptr	limbs			= f->_mp_d;

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

    

    <color><param>7676,0F0F,5050</param>if</color> (sizeNew ==
<color><param>0000,0000,FFFF</param>0</color>)

        <color><param>7676,0F0F,5050</param>return</color>
<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>7676,0F0F,5050</param>if</color> (sizeNew == sizeOld)

        <color><param>7676,0F0F,5050</param>return</color>
<color><param>0000,0000,FFFF</param>0</color>;

    

    mpf_set_prec(f, sizeNew *
<color><param>7676,0F0F,5050</param>sizeof</color>(mp_ptr) *
<color><param>0000,0000,FFFF</param>8</color>);

                                        

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

}</fixed>


On Tuesday, Jun 24, 2003, at 23:46 America/New_York,
LingWitt@insightbb.com wrote:


<excerpt><fixed><color><param>7671,0F0A,504B</param>This is what you
meant:


unsigned</color> <color><param>7671,0F0A,504B</param>int</color>
stripLowZeroLimbs(mpf_ptr f)

{

    <color><param>7675,0F0E,504F</param>unsigned</color> 	sizeNew,
sizeOld;

    sizeNew = sizeOld = f->_mp_size;

    mp_ptr	limbs			= f->_mp_d;

    mp_ptr	limb			= <color><param>0000,0000,FFFE</param>0</color>;

    

    <color><param>7675,0F0E,504F</param>while</color> (*(limb =
limbs++) == <color><param>0000,0000,FFFE</param>0</color>)

        sizeNew--;

    

    <color><param>7675,0F0E,504F</param>if</color> (sizeNew == sizeOld)

        <color><param>7675,0F0E,504F</param>return</color>
<color><param>0000,0000,FFFE</param>0</color>;

	

    f->_mp_size = sizeNew;

    

    mp_ptr newLimbs = f->_mp_d;

    limbs--;

    <color><param>7675,0F0E,504F</param>for</color>
(<color><param>7675,0F0E,504F</param>unsigned</color>
<color><param>7675,0F0E,504F</param>int</color> index = 0; index <<
sizeNew; index++)

        newLimbs[index] = *(limbs++);

    

    <color><param>7675,0F0E,504F</param>return</color> sizeOld -
f->_mp_size;

}</fixed></excerpt>
--Apple-Mail-2-928129661--