るりまサーチ (Ruby 2.7.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.031秒)

別のキーワード

  1. bigdecimal/util to_d
  2. float to_d
  3. rsa d=
  4. rsa d
  5. matrix d

クラス

検索結果

Vector#[]=(index, value) (54610.0)

index 番目の要素を value に変更します。

...定します。
@raise TypeError ベクトルの範囲外にある整数を指定したときに、発生します。

//emlist[][ruby]{
require 'matrix'

v = Vector[0, 0, 0, 0, 0]

v[1] = 2
p v #=> Vector[0, 2, 0, 0, 0]

v[-1] = 3
p v #=> Vector[0, 2, 0, 0, 3]

v[99] = 100
# IndexError: given index...