[Haskell-beginners] beginner's type error

Brent Yorgey byorgey at seas.upenn.edu
Fri Mar 27 09:17:39 EDT 2009


> 
> thing n = n + fromIntegral (round (sqrt n))
> 
> thing n = n + round (sqrt (fromIntegral n))

Pop quiz for beginners: both of these solve the original problem, but
they are not quite the same.  What is the difference?  (Do not answer
this question if you are not a beginner!)

-Brent


More information about the Beginners mailing list