code for primes_upto

Also, changed a little mistake on floor function.