208件ヒット
[1-100件を表示]
(0.023秒)
種類
- インスタンスメソッド (192)
- 特異メソッド (16)
ライブラリ
- ビルトイン (160)
-
bigdecimal
/ util (12) - openssl (12)
- prime (24)
キーワード
- denominator (12)
- downto (24)
-
each
_ prime (12) - inspect (12)
- numerator (12)
-
prime
_ division (12) - times (12)
-
to
_ bn (12) -
to
_ d (12) -
to
_ f (12) -
to
_ i (12) -
to
_ int (12) -
to
_ r (12) -
to
_ s (12) -
try
_ convert (4) - upto (24)
検索結果
先頭5件
-
Integer
# downto(min) -> Enumerator (6201.0) -
self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。 self < min であれば何もしません。
...で 1 ずつ減らしながらブロックを繰り返し実行します。
self < min であれば何もしません。
@param min 数値
@return self を返します。
//emlist[][ruby]{
5.downto(1) {|i| print i, " " } # => 5 4 3 2 1
//}
@see Integer#upto, Numeric#step, Integer#times... -
Integer
# upto(max) -> Enumerator (6201.0) -
self から max まで 1 ずつ増やしながら繰り返します。 self > max であれば何もしません。
...self から max まで 1 ずつ増やしながら繰り返します。
self > max であれば何もしません。
@param max 数値
@return self を返します。
//emlist[][ruby]{
5.upto(10) {|i| print i, " " } # => 5 6 7 8 9 10
//}
@see Integer#downto, Numeric#step, Integer#times... -
Integer
# to _ f -> Float (6132.0) -
self を浮動小数点数(Float)に変換します。
...self を浮動小数点数(Float)に変換します。
self が Float の範囲に収まらない場合、Float::INFINITY を返します。
//emlist[][ruby]{
1.to_f # => 1.0
(Float::MAX.to_i * 2).to_f # => Infinity
(-Float::MAX.to_i * 2).to_f # => -Infinity
//}... -
Integer
# to _ bn -> OpenSSL :: BN (6126.0) -
Integer を同じ数を表す OpenSSL::BN のオブジェクトに 変換します。
...
Integer を同じ数を表す OpenSSL::BN のオブジェクトに
変換します。
//emlist[][ruby]{
require 'pp'
require 'openssl'
pp 5.to_bn #=> #<OpenSSL::BN 5>
pp (-5).to_bn #=> #<OpenSSL::BN -5>
//}
なお、実装は、以下のようになっています。
//emlist[][ruby]{
clas......s Integer
def to_bn
OpenSSL::BN::new(self)
end
end
//}
@see OpenSSL::BN.new, OpenSSL::BN#to_i......
Integer を同じ数を表す OpenSSL::BN のオブジェクトに
変換します。
//emlist[][ruby]{
require 'openssl'
pp 5.to_bn #=> #<OpenSSL::BN 5>
pp (-5).to_bn #=> #<OpenSSL::BN -5>
//}
なお、実装は、以下のようになっています。
//emlist[][ruby]{
class Integer
d......ef to_bn
OpenSSL::BN::new(self)
end
end
//}
@see OpenSSL::BN.new, OpenSSL::BN#to_i... -
Integer
# to _ r -> Rational (6114.0) -
自身を Rational に変換します。
...自身を Rational に変換します。
//emlist[][ruby]{
1.to_r # => (1/1)
(1<<64).to_r # => (18446744073709551616/1)
//}... -
Integer
# to _ i -> self (6109.0) -
self を返します。
...self を返します。
//emlist[][ruby]{
10.to_i # => 10
//}... -
Integer
# to _ int -> self (6109.0) -
self を返します。
...self を返します。
//emlist[][ruby]{
10.to_i # => 10
//}... -
Integer
# to _ d -> BigDecimal (6102.0) -
自身を BigDecimal に変換します。BigDecimal(self) と同じです。
自身を BigDecimal に変換します。BigDecimal(self) と同じです。
@return BigDecimal に変換したオブジェクト -
Integer
# denominator -> Integer (6101.0) -
分母(常に1)を返します。
...分母(常に1)を返します。
@return 分母を返します。
//emlist[][ruby]{
10.denominator # => 1
-10.denominator # => 1
//}
@see Integer#numerator...