master
CrossNox 3 years ago
parent d0e4ed6685
commit 3822b23679
  1. 12
      src/rustint/core.clj

@ -2203,14 +2203,10 @@
; [10] ; [10]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn pasar-a-float [arg] (defn pasar-a-float [arg]
(if (cond
(string? arg) (number? arg) (float arg)
( (string? arg) (if (re-find #"^-?\d+\.?\d*$" arg) (float (read-string arg)) arg)
try :else (arg)
(reduce #(+ (* 10 %1) %2) (map #(- %1 48) (map int (map char arg))))
(catch ClassCastException e (arg))
)
arg
) )
) )

Loading…
Cancel
Save