4件ヒット
[1-4件を表示]
(0.071秒)
別のキーワード
検索結果
-
Integer
# to _ i -> self (54925.0) -
self を返します。
self を返します。
//emlist[][ruby]{
10.to_i # => 10
//} -
Integer
# to _ int -> self (18925.0) -
self を返します。
self を返します。
//emlist[][ruby]{
10.to_i # => 10
//} -
Integer
# to _ bn -> OpenSSL :: BN (676.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
# to _ f -> Float (658.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
//}