60件ヒット
[1-60件を表示]
(0.042秒)
検索結果
先頭5件
-
Kernel
. # Integer(arg , base = 0) -> Integer (18383.0) -
引数を整数 (Fixnum,Bignum) に変換した結果を返します。
...した場合に発生します。
@raise TypeError メソッド to_int, to_i を持たないオブジェクトを引数に指定したか、to_int, to_i
が整数(Integerのサブクラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発......4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9
p Integer(nil) # can't convert nil into Integer (TypeError)
p Integer(Object.new) # cannot convert Object into Integer (TypeError)
p Integer("10") #=> 10
p Integer("10", 2) #=> 2
p Integer("0d10") #=> 10
p Integer("0......#=> 8
p Integer("0o10") #=> 8
p Integer("0x10") #=> 16
p Integer("0b10") #=> 2
p Integer(" \n10\t ") #=> 10 # 先頭と末尾の空白類は無視される
p Integer("1\n0") # `Integer': invalid value for Integer: "1\n0" (ArgumentError)
p Integer("hoge") # `Integer': invalid... -
Kernel
. # Integer(arg , base = 0 , exception: true) -> Integer | nil (18383.0) -
引数を整数 に変換した結果を返します。
...した場合に発生します。
@raise TypeError メソッド to_int, to_i を持たないオブジェクトを引数に指定したか、to_int, to_i
が整数(Integerのサブクラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発......4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9
p Integer(nil) # can't convert nil into Integer (TypeError)
p Integer(Object.new) # cannot convert Object into Integer (TypeError)
p Integer("10") #=> 10
p Integer("10", 2) #=> 2
p Integer("0d10") #=> 10
p Integer("0......#=> 8
p Integer("0o10") #=> 8
p Integer("0x10") #=> 16
p Integer("0b10") #=> 2
p Integer(" \n10\t ") #=> 10 # 先頭と末尾の空白類は無視される
p Integer("1\n0") # `Integer': invalid value for Integer: "1\n0" (ArgumentError)
p Integer("hoge") # `Integer': invalid... -
Math
. # frexp(x) -> [Float , Integer] (108.0) -
実数 x の仮数部と指数部の配列を返します。
...実数 x の仮数部と指数部の配列を返します。
@param x 実数
@raise TypeError x に数値以外を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
fraction, exponent = Math.frexp(1... -
Math
. # lgamma(x) -> [Float , Integer] (108.0) -
log(|gamma(x)|) と、gamma(x) の符号を返します。
...log(|gamma(x)|) と、gamma(x) の符号を返します。
符号は +1 もしくは -1 で返されます。
@param x 実数
@raise TypeError xに数値以外を指定した場合に発生します。
@raise Math::DomainError x に -∞ を渡した場合に発生します。
@raise RangeErro... -
Kernel
. # putc(ch) -> object (13.0) -
文字 ch を 標準出力 $stdout に出力します。
...込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。
@raise TypeError Integer に変換できないオブジェクトを引数に
指定した場合に発生します。
//emlist[例][ruby]{
putc("ch"... -
Math
. # sqrt(x) -> Float (13.0) -
x の非負の平方根(principal square root)を返します。
...x の非負の平方根(principal square root)を返します。
@param x 0または正の実数
@raise TypeError xに数値以外を指定した場合に発生します。
@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。
@raise RangeError xに実......1.0, 1.0]
# [2, 1.4142135623731, 2.0]
# [3, 1.73205080756888, 3.0]
# [4, 2.0, 4.0]
# [5, 2.23606797749979, 5.0]
# [6, 2.44948974278318, 6.0]
# [7, 2.64575131106459, 7.0]
# [8, 2.82842712474619, 8.0]
# [9, 3.0, 9.0]
# [10, 3.16227766016838, 10.0]
//}
@see Integer.sqrt, Math.#cbrt...