るりまサーチ

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

別のキーワード

  1. numeric step
  2. _builtin numeric
  3. numeric ceil
  4. numeric real
  5. numeric fdiv

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

Numeric#ceil -> Integer (39143.0)

自身と等しいかより大きな整数のうち最小のものを返します。

...自身と等しいかより大きな整数のうち最小のものを返します。

//emlist[例][ruby]{
1.ceil #=> 1
1.2.ceil #=> 2
(-1.2).ceil #=> -1
(-1.5).ceil #=> -1
//}

@see Numeric#floor, Numeric#round, Numeric#truncate...

Numeric (38184.0)

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

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

演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで...
...提供されているメソッド
(+, -, *, /, %) を利用して定義されるものがほとんどです。
つまり Numeric で定義されているメソッドは、Numeric のサブクラスとして新たに数値クラスを定義した時に、
演算メソッド(+, -, *, /, %, <=>, coerce...
...- o - o
bit_length | - - o o - - -
ceil
| o o - - o o -
chr | - o -...
...arg | o - o - o
bit_length | - o - - -
ceil
| o o o o -
chr | - o - - -...

Numeric#floor -> Integer (21024.0)

自身と等しいかより小さな整数のうち最大のものを返します。

...自身と等しいかより小さな整数のうち最大のものを返します。


//emlist[例][ruby]{
1.floor #=> 1
1.2.floor #=> 1
(-1.2).floor #=> -2
(-1.5).floor #=> -2
//}

@see Numeric#ceil, Numeric#round, Numeric#truncate...

Numeric#floor(ndigits = 0) -> Integer (21024.0)

自身と等しいかより小さな整数のうち最大のものを返します。

...負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。

//emlist[例][ruby]{
1.floor #=> 1
1.2.floor #=> 1
(-1.2).floor #=> -2
(-1.5).floor #=> -2
//}

@see Numeric#ceil, Numeric#round, Numeric#truncate
@see Integer#floor...

Numeric#floor(ndigits = 0) -> Integer | Float (21024.0)

自身と等しいかより小さな整数のうち最大のものを返します。

...Integer を返します。
小数点位置から左に少なくとも n 個の 0 が並びます。

//emlist[例][ruby]{
1.floor #=> 1
1.2.floor #=> 1
(-1.2).floor #=> -2
(-1.5).floor #=> -2
//}

@see Numeric#ceil, Numeric#round, Numeric#truncate
@see Integer#floor...

絞り込み条件を変える

Numeric#round -> Integer (21024.0)

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

...0.5, -0.5 はそれぞれ 1,-1 に切り上げされます。いわゆる四捨五入ですが、偶数丸めではありません。

//emlist[例][ruby]{
1.round #=> 1
1.2.round #=> 1
(-1.2).round #=> -1
(-1.5).round #=> -2
//}

@see Numeric#ceil, Numeric#floor, Numeric#truncate...

Numeric#truncate -> Integer (21024.0)

0 から 自身までの整数で、自身にもっとも近い整数を返します。

...0 から 自身までの整数で、自身にもっとも近い整数を返します。

//emlist[例][ruby]{
1.truncate #=> 1
1.2.truncate #=> 1
(-1.2).truncate #=> -1
(-1.5).truncate #=> -1
//}

@see Numeric#ceil, Numeric#floor, Numeric#round...

Integer#ceil(ndigits = 0) -> Integer (18137.0)

self と等しいかより大きな整数のうち最小のものを返します。

...数を整数で指定します。
負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。

//emlist[][ruby]{
1.ceil # => 1
1.ceil(2) # => 1
18.ceil(-1) # => 20
(-18).ceil(-1) # => -10
//}

@see Numeric#ceil...

Integer#ceil(ndigits = 0) -> Integer | Float (18137.0)

self と等しいかより大きな整数のうち最小のものを返します。

...負の整数を指定した場合、Integer を返します。
小数点位置から左に少なくとも n 個の 0 が並びます。

//emlist[][ruby]{
1.ceil # => 1
1.ceil(2) # => 1.0
18.ceil(-1) # => 20
(-18).ceil(-1) # => -10
//}

@see Numeric#ceil...

NEWS for Ruby 2.4.0 (30.0)

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

...ttps://github.com/ruby/ruby/pull/1186
* Enumerator::Lazy#uniq を追加 11090

* File
* File.empty? を追加 9969

* Float
* Float#ceil, Float#floor, Float#truncate は
Float#roundと同じように省略可能な桁を指定する引数を受け付けるようになりまし...
...ansform_values Hash#transform_values! を追加 12512

* Integer
* Fixnum と Bignum は Integer に統合されました 12005
* Integer#ceil, Integer#floor, Integer#truncate は
Integer#round と同じように省略可能な桁を指定する引数を受け付けるようになり...
...le#refine 引数としてモジュールを許可するようになりました 12534
* Module.used_modules を追加 7418

* Numeric
* Numeric#finite?, Numeric#infinite? を追加 12039

* Process
* macOS 10.12 から導入された CLOCK_MONOTONIC_RAW_APPROX, CLOCK_UPTIME_RAW,...

絞り込み条件を変える

Float#to_i -> Integer (24.0)

小数点以下を切り捨てて値を整数に変換します。

...小数点以下を切り捨てて値を整数に変換します。


//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
//}

@see Numeric#round, Numeric#ceil, Numeric#floor...
...す。
小数点位置から左に少なくとも n 個の 0 が並びます。

//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
1.234567.truncate(2) # => 1.23
34567.89.truncate(-2) # => 34500
//}

@see Numeric#round, Numeric#ceil, Numeric#floor...

Float#truncate -> Integer (24.0)

小数点以下を切り捨てて値を整数に変換します。

...小数点以下を切り捨てて値を整数に変換します。


//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
//}

@see Numeric#round, Numeric#ceil, Numeric#floor...

Float#truncate(ndigits = 0) -> Integer | Float (24.0)

小数点以下を切り捨てて値を整数に変換します。

...す。
小数点位置から左に少なくとも n 個の 0 が並びます。

//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
1.234567.truncate(2) # => 1.23
34567.89.truncate(-2) # => 34500
//}

@see Numeric#round, Numeric#ceil, Numeric#floor...

Float#floor -> Integer (18.0)

自身と等しいかより小さな整数のうち最大のものを返します。

...自身と等しいかより小さな整数のうち最大のものを返します。


//emlist[例][ruby]{
1.2.floor # => 1
2.0.floor # => 2
(-1.2).floor # => -2
(-2.0).floor # => -2
//}

@see Numeric#ceil, Numeric#round, Float#truncate...

Float#floor(ndigits = 0) -> Integer | Float (18.0)

自身と等しいかより小さな整数のうち最大のものを返します。

...oor(-4) # => 30000
34567.89.floor(-3) # => 34000
34567.89.floor(-2) # => 34500
34567.89.floor(-1) # => 34560
34567.89.floor(0) # => 34567
34567.89.floor(1) # => 34567.8
34567.89.floor(2) # => 34567.89
34567.89.floor(3) # => 34567.89
//}

@see Numeric#ceil, Numeric#round, Float#truncate...

絞り込み条件を変える

<< 1 2 > >>