ClojureDocs

Nav

Namespaces

aset-float

clojure.core

Available since 1.0 (source)
  • (aset-float array idx val)
  • (aset-float array idx idx2 & idxv)
Sets the value at the index/indices. Works on arrays of float. Returns val.
1 Example
;; create an array of 10 floats and set one of the values to 3.1415

user=> (def fs (float-array 10))
#'user/fs
user=> (vec fs)
[0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0]
user=> (aset-float fs 3 3.1415)
3.1415
user=> (vec fs)
[0.0 0.0 0.0 3.1415 0.0 0.0 0.0 0.0 0.0 0.0]
user=>
See Also

Returns the value at the index/indices. Works on Java arrays of all types.

Added by rosejn
1 Note
    By , created 9.9 years ago

    See aset for illustrations of multi-dimensional syntax.