0
此代码,我写给我的错误:Clojure的正常化功能运行时错误
java.lang.Long cannot be cast to clojure.lang.IFn
这意味着我使用的数,其中一个函数的预期。
我认为它与clojure.math.numeric-tower的expt函数有关,但我不确定。神秘的错误消息FTL。
(ns point-normalize.core
(:require [clojure.math.numeric-tower :as math :only (sqrt expt)]))
(defn normalize [x y]
(let [x1 (/ x (math/sqrt ((math/expt x 2)+ (math/expt y 2))))
y1 (/ y (math/sqrt ((math/expt x 2)+ (math/expt y 2))))]
(x1 y1)))
任何提示将不胜感激。谢谢。
哦,我的天......我只是用C++编程,所以这就是为什么。谢谢! – Cody