るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

Rational#-(other) -> Rational | Float (21249.0)

差を計算します。

...差を計算します。

@
param other 自身から引く数

other に Float を指定した場合は、計算結果を Float で返しま
す。

//emlist[例][ruby]{
r
= Rational(3, 4)
r
- 1 # => (-1/4)
r
- 0.5 # => 0.25
//}...

Array#-(other) -> Array (21243.0)

自身から other の要素を取り除いた配列を生成して返します。

...自身から other の要素を取り除いた配列を生成して返します。

要素の同一性は Object#eql? により評価されます。
self 中で重複していて、other中に存在していなかった要素は、その重複が保持されます。

@
param other 自身から取...
...場合は to_ary メソッドによ
る暗黙の型変換を試みます。

@
raise TypeError 引数に配列以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

//emlist[例][ruby]{
[1, 2, 1, 3, 1, 4] - [4, 2] #...
...=> [1, 1, 3, 1]

[1, 2, 1, 3, 1, 4] - [1, 4] # => [2, 3]
//}...
...=> [1, 1, 3, 1]

[1, 2, 1, 3, 1, 4] - [1, 4] # => [2, 3]
//}


@
see Array#difference...

Integer#-(other) -> Numeric (21231.0)

算術演算子。差を計算します。

...算術演算子。差を計算します。

@
param other 二項演算の右側の引数(対象)
@
return 計算結果

//emlist[][ruby]{
4 - 1 #=> 3
//}...

Complex#-(other) -> Complex (18231.0)

差を計算します。

...差を計算します。

@
param other 自身から引く数

//emlist[例][ruby]{
Complex(1, 2) - Complex(2, 3) # => (-1-1i)
//}...

Float#-(other) -> Float (18225.0)

算術演算子。差を計算します。

...算術演算子。差を計算します。

@
param other 二項演算の右側の引数(対象)

//emlist[例][ruby]{
# 差
4.5 - 1.3 # => 3.2
//}...

絞り込み条件を変える

Vector#r -> Float (18220.0)

ベクトルの大きさ(ノルム)を返します。

...ベクトルの大きさ(ノルム)を返します。

//emlist[例][ruby]{
r
equire 'matrix'
Vector[3, 4].norm # => 5.0
Vector[Complex(0, 1), 0].norm # => 1.0
//}

@
see Vector#normalize...

Integer#-@ -> Integer (15353.0)

単項演算子の - です。 self の符号を反転させたものを返します。

...単項演算子の - です。
self の符号を反転させたものを返します。

//emlist[][ruby]{
-
10 # => -10
-
-10 # => 10
//}...

Rational#-@ -> Rational (15347.0)

単項演算子の - です。 self の符号を反転させたものを返します。

...単項演算子の - です。
self の符号を反転させたものを返します。

//emlist[例][ruby]{
r
= Rational(3, 4)
-
r # => (-3/4)
//}...

String#-@ -> String | self (15331.0)

self が freeze されている文字列の場合、self を返します。 freeze されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。

...freeze されている文字列の場合、self を返します。
freeze されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。

//emlist[例][ruby]{
# frozen_string_literal: false

original_text = "text"
frozen_text = -original_text
froz...
...en_text.frozen? # => true
original_text == frozen_text # => true
original_text.equal?(frozen_text) # => false

original_text = "text".freeze
frozen_text = -original_text
frozen_text.frozen? # => true
original_text == frozen_text # => true
original_text...
....equal?(frozen_text) # => true
//}

@
see String#+@...
<< 1 2 3 ... > >>