3 ms·
What would you like that code to do? Fork the process and set x = sqrt(2) in one branch and x = -sqrt(2) in the other? In fact, should its behaviour depend on w
by gjm11 14y ago
What would you like that code to do? Fork the process and set x = sqrt(2) in one branch and x = -sqrt(2) in the other? In fact, should its behaviour depend on whether or not your floating-point implementation has a value such that x == 2/x holds exactly?
No, wait, Real is actually a type class, not a type, right? Perhaps when you write that code the system should extend itself to support an infinite-precision real-number type that implements Real, and make x be exactly sqrt(2)? (And exactly -sqrt(2), of course.)
All of which is just another way of saying: I really don't think it's quite fair to be disappointed that Haskell doesn't try to solve the extremely difficult (not to say provably unsolvable) problems of "doing logic to figure it out".