Solving quadratic equation in Clojure
Is using a set a good solution for avoiding having the same return value twice, if the two solutions are equal? (I am worrying that they might not be always exactly equal, due to imprecision in calculation.)


Instead of a set, IMO a vector would be a better structure.  It is essentially a "list of solutions."  Instead of your (set [x1 x2... simply wrap it in a vector:

(vec (hash-set x1 x2))


There's nothing wrong with using a set, but vectors are more common. Sets tend to be used more for utility in computation, rather than as a way to convey expression results.  There are always exceptions, and you could very well make one here if you chose to do so.


  Independently whether sets should be used for this particular problem or not, is there a better way to compare two sets for equality, with a custom function between the elements? (C.f., line (1))


I'm not the expert on floating-point comparisons, but I wonder if the following would work, or if it's too naive:

(def s1 #{1.0 2.0})
(def s2 #{1 2})
(= (set (map double s1)) (set (map double s2)))  ; true