110513Sdlw /* 2*22936Skre * Copyright (c) 1980 Regents of the University of California. 3*22936Skre * All rights reserved. The Berkeley software License Agreement 4*22936Skre * specifies the terms and conditions for redistribution. 5*22936Skre * 6*22936Skre * @(#)pow_hh.c 5.1 06/07/85 710513Sdlw */ 810513Sdlw 910513Sdlw short pow_hh(ap, bp) 1010513Sdlw short *ap, *bp; 1110513Sdlw { 1210513Sdlw short pow, x, n; 1310513Sdlw 1410513Sdlw pow = 1; 1510513Sdlw x = *ap; 1610513Sdlw n = *bp; 1710513Sdlw 1810513Sdlw if(n < 0) 1910513Sdlw { } 2010513Sdlw else if(n > 0) 2110513Sdlw for( ; ; ) 2210513Sdlw { 2310513Sdlw if(n & 01) 2410513Sdlw pow *= x; 2510513Sdlw if(n >>= 1) 2610513Sdlw x *= x; 2710513Sdlw else 2810513Sdlw break; 2910513Sdlw } 3010513Sdlw return(pow); 3110513Sdlw } 32