public static double hypot (double x, double y) { final double x2 = x * x; final double y2 = y * y; return Math.sqrt(x2 + y2); }In Clojure
(defn hypot [x y] (let [x2 (* x x) y2 (* y y)] (Math/sqrt (+ x2 y2)) ) )The execution
(println (hypot 2 3))
public static double hypot (double x, double y) { final double x2 = x * x; final double y2 = y * y; return Math.sqrt(x2 + y2); }In Clojure
(defn hypot [x y] (let [x2 (* x x) y2 (* y y)] (Math/sqrt (+ x2 y2)) ) )The execution
(println (hypot 2 3))
(defn average [numbers] (/ (apply + numbers) (count numbers) ) ) (println (average [1 2 3 4 5]) )