Calculates the value of input according to a specified modulus, using double precision floating values.