Subversion Repositories planix.SVN

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 33
Line 13... Line 13...
13
	if(b->top==0){
13
	if(b->top==0){
14
		res->top = 0;
14
		res->top = 0;
15
		return;
15
		return;
16
	}
16
	}
17
 
17
 
18
	// a negative left shift is a right shift
18
	// a zero or negative left shift is a right shift
19
	if(shift < 0){
19
	if(shift <= 0){
20
		mpright(b, -shift, res);
20
		mpright(b, -shift, res);
21
		return;
21
		return;
22
	}
22
	}
23
 
23
 
24
	// b and res may be the same so remember the old top
24
	// b and res may be the same so remember the old top
Line 44... Line 44...
44
		res->p[d] = last<<l;
44
		res->p[d] = last<<l;
45
	}
45
	}
46
	for(i = 0; i < d; i++)
46
	for(i = 0; i < d; i++)
47
		res->p[i] = 0;
47
		res->p[i] = 0;
48
 
48
 
49
	// normalize
-
 
50
	while(res->top > 0 && res->p[res->top-1] == 0)
49
	res->flags |= b->flags & MPtimesafe;
51
		res->top--;
50
	mpnorm(res);
52
}
51
}