multiplicity function edited , now returns inifinity when n equals 0, and also returns infinty when p equals 2 and n equals zero, which previously was returning zero 

for issues #8159 and #8145
i think that if line is moved up, then conditions when p < 2, which according to the definition should not be, will also get considered and then answer wouls simply return as infinity. For example multiplicity(2, 0) would also return infinity