るりまサーチ

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

別のキーワード

  1. _builtin typeerror
  2. sort typeerror
  3. dump typeerror
  4. typeerror argumenterror
  5. typeerror _builtin

ライブラリ

モジュール

キーワード

検索結果

Kernel.#Integer(arg, base = 0) -> Integer (18401.0)

引数を整数 (Fixnum,Bignum) に変換した結果を返します。

...数) です。


@raise ArgumentError 整数と見なせない文字列を引数に指定した場合に発生します。
@raise TypeError メソッド to_int, to_i を持たないオブジェクトを引数に指定したか、to_int, to_i
が整数(Integerのサブクラス)を返さ...
...発生します。
@raise TypeError 引数に nil を指定した場合に発生します。

//emlist[例][ruby]{
p Integer(4) #=> 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("010") #=> 8
p Integer("0o10") #=> 8
p Integer("0x10") #=> 16
p Integer("0b10") #=> 2
p Integer(" \n10\t ") #=> 10 # 先頭と末尾の空白類...

Kernel.#Integer(arg, base = 0, exception: true) -> Integer | nil (18401.0)

引数を整数 (Fixnum,Bignum) に変換した結果を返します。

...に nil を返します。

@raise ArgumentError 整数と見なせない文字列を引数に指定した場合に発生します。
@raise TypeError メソッド to_int, to_i を持たないオブジェクトを引数に指定したか、to_int, to_i
が整数(Integerのサブクラス)を返さ...
...発生します。
@raise TypeError 引数に nil を指定した場合に発生します。

//emlist[例][ruby]{
p Integer(4) #=> 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("010") #=> 8
p Integer("0o10") #=> 8
p Integer("0x10") #=> 16
p Integer("0b10") #=> 2
p Integer(" \n10\t ") #=> 10 # 先頭と末尾の空白類...

Math.#lgamma(x) -> [Float, Integer] (126.0)

log(|gamma(x)|) と、gamma(x) の符号を返します。

...符号は +1 もしくは -1 で返されます。

@param x 実数

@raise TypeError xに数値以外を指定した場合に発生します。

@raise Math::DomainError x に -∞ を渡した場合に発生します。

@raise RangeError xに実数以外の数値を指定した場合に発生し...

Math.#frexp(x) -> [Float, Integer] (120.0)

実数 x の仮数部と指数部の配列を返します。

...実数 x の仮数部と指数部の配列を返します。

@param x 実数

@raise TypeError x に数値以外を指定した場合に発生します。

@raise RangeError x に実数以外の数値を指定した場合に発生します。

//emlist[例][ruby]{
fraction, exponent = Math.frexp(1...

Kernel.#putc(ch) -> object (37.0)

文字 ch を 標準出力 $stdout に出力します。

...を返します
@raise RangeError Bignum を引数にした場合に発生します。
@raise IOError 標準出力が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。
@raise TypeError Integer に変換でき...

絞り込み条件を変える

Math.#sqrt(x) -> Float (31.0)

x の非負の平方根(principal square root)を返します。

...e 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...