Arithmetic/Complex: Difference between revisions
Content deleted Content added
Line 622:
(defrecord Complex [r i]
Object
(toString [this] (apply str (
(defmethod ari/+ [Complex Complex]
[x y] (map->Complex (merge-with +
(defmethod ari/+ [Complex java.lang.Number]
[
(defmethod ari/- Complex
[x] (->
(defmethod ari/* [Complex Complex]
[x y] (map->Complex (merge-with *
(defmethod ari/* [Complex java.lang.Number]
[
(ari/defmethod* ari / Complex
[x] (->
(defn conj [^Complex
(->Complex
(defn inv [^Complex
(let [
(->Complex (/ r m) (- (/ i m)))))
</lang>
|