You're viewing version 1.2.0 of doubles. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

doubles

clojure.core

  • (doubles xs)
Casts to double[]

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:4237 top

(definline doubles
  "Casts to double[]"
  {:added "1.0"}
  [xs] `(. clojure.lang.Numbers doubles ~xs))
Vars in clojure.core/doubles: definline concat list seq
Used in 0 other vars

Comments top

1 comment(s) for doubles.

Anybody know what this is used for? All I could find is that you can cast an existing double-array to another double-array???

user=> (doubles [1 2 3 4 5])
java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to [D (NO_SOURCE_FILE:0)
user=> (doubles (int-array [2 3 2]))
java.lang.ClassCastException: [I cannot be cast to [D (NO_SOURCE_FILE:0)
user=> (doubles (float-array [2 3 2]))
java.lang.ClassCastException: [F cannot be cast to [D (NO_SOURCE_FILE:0)
user=> (doubles (double-array [2 3 2]))
#
user=> (type (double-array [2 3 2]))
[D
user=> (type (doubles (double-array [2 3 2])))
[D
user=>
Log in to add a comment.