Subversion Repositories planix.SVN

Rev

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

Rev 22 Rev 26
Line 16... Line 16...
16
 
16
 
17
	// return highest digit value if the result >= 2**32
17
	// return highest digit value if the result >= 2**32
18
	if(hi >= divisor || divisor == 0){
18
	if(hi >= divisor || divisor == 0){
19
		divisor = 0;
19
		divisor = 0;
20
		*quotient = ~divisor;
20
		*quotient = ~divisor;
-
 
21
		return;
-
 
22
	}
-
 
23
 
-
 
24
	// very common case
-
 
25
	if(~divisor == 0){
-
 
26
		lo += hi;
-
 
27
		if(lo < hi){
-
 
28
			hi++;
-
 
29
			lo++;
-
 
30
		}
-
 
31
		if(lo+1 == 0)
-
 
32
			hi++;
-
 
33
		*quotient = hi;
21
		return;
34
		return;
22
	}
35
	}
23
 
36
 
24
	// at this point we know that hi < divisor
37
	// at this point we know that hi < divisor
25
	// just shift and subtract till we're done
38
	// just shift and subtract till we're done