るりまサーチ

最速Rubyリファレンスマニュアル検索!
128件ヒット [1-100件を表示] (0.070秒)
トップページ > クエリ:Integer[x] > クエリ:on[x] > モジュール:Kernel[x]

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer chr
  5. integer new

ライブラリ

キーワード

検索結果

<< 1 2 > >>

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

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

...フィクスは、0b
(2 進数)、0 (8 進数)、0o (8 進数)、0d (10 進数)、0x (16 進
数) です。

@param exception false を指定すると、変換できなかった場合、
例外を発生する代わりに nil を返します。

@raise Argumen...
...数(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...

Kernel.#Rational(x, y = 1, exception: true) -> Rational | nil (6307.0)

引数を有理数(Rational)に変換した結果を返します。

...有理数(Rational)に変換した結果を返します。

@param x 変換対象のオブジェクトです。

@param y 変換対象のオブジェクトです。省略した場合は x だけを用いて
Rational オブジェクトを作成します。

@param exception false を指定...
...また、Kernel.#Integer とは違い "0x10" のような進数を表す接頭
辞を含めた指定は行えません。

//emlist[例][ruby]{
Rational("1/3") # => (1/3)
Rational("0.3") # => (3/10)
Rational('0.3E0') # => (3/10)
Rational('0.1E1/3') # => (1/3)
Rational('1.2/3')...
...# => (2/5)
Rational('1/3.1') # => ArgumentError
Rational('3.0', '3.0') # => (1/1)
Rational('3/3', '3/3') # => (1/1)
Rational('1_234_567') # => (1234567/1)
Rational(" \n10\t ") # => (10/1) # 空白類は無視される
Rational("0x10") # => ArgumentError
//}

引数に変換でき...

Kernel#try_constant(const, headers = nil, opt = "") -> Integer | nil (6303.0)

定数 const がシステムに存在するかどうか検査します。 Kernel#have_const を使ってください。

...定数 const がシステムに存在するかどうか検査します。
Kernel
#have_const を使ってください。

@param const C 言語の定数名を指定します。

@param headers 追加のヘッダファイルを指定します。

@param opt コンパイラに渡すオプションを...
...指定します。
$CFLAGS もコンパイラには渡されます。

@return 定数 const がシステムに存在する場合はその値を返します。
定数 const がシステムに存在しない場合は nil を返します。...

Kernel#try_constant(const, headers = nil, opt = "") { ... } -> Integer | nil (6303.0)

定数 const がシステムに存在するかどうか検査します。 Kernel#have_const を使ってください。

...定数 const がシステムに存在するかどうか検査します。
Kernel
#have_const を使ってください。

@param const C 言語の定数名を指定します。

@param headers 追加のヘッダファイルを指定します。

@param opt コンパイラに渡すオプションを...
...指定します。
$CFLAGS もコンパイラには渡されます。

@return 定数 const がシステムに存在する場合はその値を返します。
定数 const がシステムに存在しない場合は nil を返します。...

Kernel.#Rational(x, y = 1) -> Rational (6207.0)

引数を有理数(Rational)に変換した結果を返します。

...引数を有理数(Rational)に変換した結果を返します。

@param x 変換対象のオブジェクトです。

@param y 変換対象のオブジェクトです。省略した場合は x だけを用いて
Rational オブジェクトを作成します。


@raise ArgumentError...
...また、Kernel.#Integer とは違い "0x10" のような進数を表す接頭
辞を含めた指定は行えません。

//emlist[例][ruby]{
Rational("1/3") # => (1/3)
Rational("0.3") # => (3/10)
Rational('0.3E0') # => (3/10)
Rational('0.1E1/3') # => (1/3)
Rational('1.2/3')...
...# => (2/5)
Rational('1/3.1') # => ArgumentError
Rational('3.0', '3.0') # => (1/1)
Rational('3/3', '3/3') # => (1/1)
Rational('1_234_567') # => (1234567/1)
Rational(" \n10\t ") # => (10/1) # 空白類は無視される
Rational("0x10") # => ArgumentError
//}

引数に変換でき...

絞り込み条件を変える

Kernel#convertible_int(type, headers = nil, opts = nil) (6149.0)

Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG

...Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.

If the +type+ is a integer type and _convertible_ type is found,
following macros are p...
...assed as preprocessor constants to the
compiler using the +type+ name, in uppercase.

* 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X'
is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP,
where 'TYP' is the +type+ name in uppercase with replacing '_t'
suff...
...is the macro name to
convert +type+ to +Integer+ object, and vice versa.

For example, if foobar_t is defined as unsigned long, then
convertible_int("foobar_t") would return "unsigned long", and define
macros:

#define TYPEOF_FOOBAR_T unsigned long
#define FOOBART2NUM ULONG2NUM
#de...

Kernel#convertible_int(type, headers = nil, opts = nil) { ... } (6149.0)

Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG

...Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.

If the +type+ is a integer type and _convertible_ type is found,
following macros are p...
...assed as preprocessor constants to the
compiler using the +type+ name, in uppercase.

* 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X'
is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP,
where 'TYP' is the +type+ name in uppercase with replacing '_t'
suff...
...is the macro name to
convert +type+ to +Integer+ object, and vice versa.

For example, if foobar_t is defined as unsigned long, then
convertible_int("foobar_t") would return "unsigned long", and define
macros:

#define TYPEOF_FOOBAR_T unsigned long
#define FOOBART2NUM ULONG2NUM
#de...

Kernel.#spawn(env, program, *args, options={}) -> Integer (211.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...ム名になります。
また、第1要素はフルパスで指定しなくても環境変数 PATH から探します。

=== option引数の概要
Hash を options として渡すことで、起動される子プロセスの
* プロセスグループ
* resource limit
* カレントディ...
...、0(stdin), 1(stdout), 2(stderr) 以外の
ファイルデスクリプタをすべて閉じます。
true がデフォルトです。


=== option引数によるリダイレクトの概要
Hash のキー(子プロセス側)には以下のいずれかが指定できます。
* 単一のファ...
...レクト先のファイル名文字列
* [リダイレクト先のファイル名文字列]、配列の要素にすることで
File::Constants::RDONLY でファイルを開いてリダイレクトします。
* [リダイレクト先のファイル名文字列, モード文字列]
open...
...
false がデフォルトです。

: :exception
Kernel
.#system のみで指定できます。
これを true に設定すると、nil や false を返す代わりに例外が発生します。
false がデフォルトです。

=== option引数によるリダイレクトの概要
Hash...

Kernel.#spawn(command, options={}) -> Integer (206.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。

@raise Errno::EXXX コマンドが実行できなかった場合に発生します。


@see Kernel.#system,Kernel.#exec...

Kernel.#spawn(env, command, options={}) -> Integer (206.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。

@raise Errno::EXXX コマンドが実行できなかった場合に発生します。


@see Kernel.#system,Kernel.#exec...

絞り込み条件を変える

Kernel.#spawn(program, *args) -> Integer (111.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...ム名になります。
また、第1要素はフルパスで指定しなくても環境変数 PATH から探します。

=== option引数の概要
Hash を options として渡すことで、起動される子プロセスの
* プロセスグループ
* resource limit
* カレントディ...
...、0(stdin), 1(stdout), 2(stderr) 以外の
ファイルデスクリプタをすべて閉じます。
true がデフォルトです。


=== option引数によるリダイレクトの概要
Hash のキー(子プロセス側)には以下のいずれかが指定できます。
* 単一のファ...
...レクト先のファイル名文字列
* [リダイレクト先のファイル名文字列]、配列の要素にすることで
File::Constants::RDONLY でファイルを開いてリダイレクトします。
* [リダイレクト先のファイル名文字列, モード文字列]
open...
...
false がデフォルトです。

: :exception
Kernel
.#system のみで指定できます。
これを true に設定すると、nil や false を返す代わりに例外が発生します。
false がデフォルトです。

=== option引数によるリダイレクトの概要
Hash...
<< 1 2 > >>