るりまサーチ

最速Rubyリファレンスマニュアル検索!
62件ヒット [1-62件を表示] (0.029秒)
トップページ > クエリ:self[x] > クエリ:round[x]

別のキーワード

  1. object yield_self
  2. _builtin yield_self
  3. _builtin self
  4. tracepoint self
  5. codeobject document_self

ライブラリ

クラス

キーワード

検索結果

Integer#round(ndigits = 0, half: :up) -> Integer (18201.0)

self ともっとも近い整数を返します。

...
self
ともっとも近い整数を返します。

@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。
@param half ちょうど半分の...
...y]{
1.round # => 1
1.round(2) # => 1
15.round(-1) # => 20
(-15).round(-1) # => -20

25.round(-1, half: :up) # => 30
25.round(-1, half: :down) # => 20
25.round(-1, half: :even) # => 20
35.round(-1, half: :up) # => 40
35.round(-1, half: :down) # => 30
35.round(-1, h...
...alf: :even) # => 40
(-25).round(-1, half: :up) # => -30
(-25).round(-1, half: :down) # => -20
(-25).round(-1, half: :even) # => -20
//}

@see Numeric#round...

Integer#round(ndigits = 0, half: :up) -> Integer | Float (18201.0)

self ともっとも近い整数を返します。

...
self
ともっとも近い整数を返します。

@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
正の整数を指定した場合、Float を返します。
小数点以下を、最大 n 桁にします。...
...]{
1.round # => 1
1.round(2) # => 1.0
15.round(-1) # => 20
(-15).round(-1) # => -20

25.round(-1, half: :up) # => 30
25.round(-1, half: :down) # => 20
25.round(-1, half: :even) # => 20
35.round(-1, half: :up) # => 40
35.round(-1, half: :down) # => 30
35.round(-1,...
...half: :even) # => 40
(-25).round(-1, half: :up) # => -30
(-25).round(-1, half: :down) # => -20
(-25).round(-1, half: :even) # => -20
//}

@see Numeric#round...

IRB::ExtendCommand::Foreground#execute(*obj) -> IRB::Irb (3006.0)

指定したサブ irb に移動します。

...ブ irb に移動します。

@param obj 移動するサブ irb を識別する以下のいずれかのオブジェクトを指定します。

* irb インタプリタ番号
* irb オブジェクト
* スレッド ID
* 各インタプリタの self (「irb(obj)」で起動した時の obj)...

Numeric (72.0)

数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。

...- - - o
remainder | o - - o - - -
round
| o o - - o o -
singleton_method_added | o - -...
...作一覧


Numeric#ceil, Numeric#floor, Numeric#round, Numeric#truncate
のふるまいの違いの表です。左の実数に対して各メソッドを呼ぶと表のような数を
返します。

| ceil floor round truncate
------------------------------...
...f roundup(d=0)
x = 10**d
if self > 0
self
.quo(x).ceil * x
else
self
.quo(x).floor * x
end
end

def rounddown(d=0)
x = 10**d
if self < 0
self
.quo(x).ceil * x
else
self
.quo(x).floor * x
end
end

def roundoff(d=0)
x = 10**d
if self...
...angular | o - - - o
remainder | o o - - -
round
| o o o o -
singleton_method_added | o - - - -...

NEWS for Ruby 2.5.0 (18.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...に改良しました。
このメッセージはユーザーにとってわかりやすいでしょう。 13405

* Integer
* Integer#round, Integer#floor, Integer#ceil, Integer#truncate は常に Integer を返すようになりました
13420
* Integer#pow を追加 12508 110...
...* BigDecimal.new
* BigDecimal.ver
* BigDecimal#clone と BigDecimal#dup は新しいインスタンスを作らなくなりました。selfを返します。

* coverage
* ブランチカバレッジとメソッドカバレッジの計測をサポートしました 13901
...

絞り込み条件を変える

Matrix#eigen -> Matrix::EigenvalueDecomposition (12.0)

行列の固有値と左右の固有ベクトルを保持したオブジェクトを返します。

...行列で、 self == V*D*W, V = W.inverse を満たします。
D のそれぞれの対角成分が行列の固有値です。

//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
v, d, v_inv = m.eigensystem
d.diagonal? # => true
v.inv == v_inv # => true
(v * d * v_inv).round(5) == m #...

Matrix#eigensystem -> Matrix::EigenvalueDecomposition (12.0)

行列の固有値と左右の固有ベクトルを保持したオブジェクトを返します。

...行列で、 self == V*D*W, V = W.inverse を満たします。
D のそれぞれの対角成分が行列の固有値です。

//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
v, d, v_inv = m.eigensystem
d.diagonal? # => true
v.inv == v_inv # => true
(v * d * v_inv).round(5) == m #...