1 //-----------------------------------------------------------------------------
3 // Factor small numerical powers
5 // Input: tos-2 Base (positive integer < 2^31 - 1)
9 // Output: Expr on stack
11 //-----------------------------------------------------------------------------
19 static void quickpower(void);
36 factor_small_number();
42 for (i
= 0; i
< n
; i
+= 2) {
43 push(s
[i
]); // factored base
44 push(s
[i
+ 1]); // factored exponent
50 // stack has n results from factor_number_raw()
52 // on top of that are all the expressions from quickpower()
54 // multiply the quickpower() results
56 multiply_all(tos
- h
- n
);
67 // BASE is a prime number so power is simpler
88 // fractional part of EXPO
100 if (expo
== (int) 0x80000000) {
115 bignum_power_number(expo
);