るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

Integer#pred -> Integer (18129.0)

self から -1 した値を返します。

...
self
から -1 した値を返します。

//emlist[][ruby]{
1.pred #=> 0
(-1).pred #=> -2
//}

@see Integer#next...

Numeric (60.0)

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

...- o - o
polar | o - - - - - o
pred
| - o - - - - -
Numeric Integer Fixnum Bi...
...**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 < 0
(self.quo(x) -...
...0.5).ceil * x
else
(self.quo(x) + 0.5).floor * x
end
end
end
//}...
...polar | o - - - o
positive? | o - o o -
pred
| - o - - -
prev_float | - - o - -...

Integer#next -> Integer (22.0)

self の次の整数を返します。

...
self
の次の整数を返します。

//emlist[][ruby]{
1.next #=> 2
(-1).next #=> 0
1.succ #=> 2
(-1).succ #=> 0
//}

@see Integer#pred...

Integer#succ -> Integer (22.0)

self の次の整数を返します。

...
self
の次の整数を返します。

//emlist[][ruby]{
1.next #=> 2
(-1).next #=> 0
1.succ #=> 2
(-1).succ #=> 0
//}

@see Integer#pred...