fact: Fixpoint scalb (sc: Z) (b:bool) (a: nelt) (p: positive) {struct p}: nelt * Z := match p with xH => if b then ndouble sc a else (a,sc) | xO p1 => let (a1, sc1) := scalb sc false a p1 in if b then let (a2, sc2) := ndouble sc1 a1 in nadd sc2 a a2 else ndouble sc1 a1 | xI p1 => let (a1, sc1) := scalb sc true a p1 in if b then ndouble sc1 a1 else let (a2, sc2) := ndouble sc1 a1 in nadd sc2 (nopp a) a2 end.
imports: Ring Field_tac Ring_tac Eqdep_dec ZArith ZCAux Ppow GZnZ EGroup SMain Zmod