i'm pretty sure anything mod one is the whole number part and to remove it you then need to subtract this from the result, so you'd have to repeat the formula with a subtract
p1^2 = (p1*p2)-((p1*p2) mod 1)
i forget what the precedence of mod is, i think it's commutative to multiply/divide thus the braces. also, mod(dividend, divisor) is programming function notation, i'm pretty sure in math notation you use mod as an infix.
i'm pretty foggy on all these things to be honest, i rarely have to decipher math notation to write algorithms, usually someone else already did that and i just copy/adapt it.