種類
- モジュール関数 (14)
- インスタンスメソッド (8)
ライブラリ
- ビルトイン (12)
- bigdecimal (2)
- mkmf (8)
キーワード
- BigDecimal (2)
- Rational (1)
-
check
_ signedness (2) -
check
_ sizeof (2) -
convertible
_ int (2) - fork (2)
- rand (2)
- spawn (4)
- test (2)
-
try
_ constant (2)
検索結果
先頭5件
- Kernel
. # Integer(arg , base = 0 , exception: true) -> Integer | nil - Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil - Kernel
# check _ signedness(type , headers = nil , opts = nil) { . . . } -> "signed" | "unsigned" | nil - Kernel
# check _ sizeof(type , headers = nil) -> Integer | nil - Kernel
# check _ sizeof(type , headers = nil) { . . . } -> Integer | nil
-
Kernel
. # Integer(arg , base = 0 , exception: true) -> Integer | nil (55453.0) -
引数を整数 (Fixnum,Bignum) に変換した結果を返します。
引数を整数
(Fixnum,Bignum)
に変換した結果を返します。
引数が数値の場合は直接変換し(小数点以下切り落とし)、
文字列の場合は、進数を表す接頭辞を含む整数表現とみなせる文字列のみ
変換します。
数値と文字列以外のオブジェクトに対しては arg.to_int, arg.to_i を
この順に使用して変換します。
@param arg 変換対象のオブジェクトです。
@param base 基数として0か2から36の整数を指定します(引数argに文字列を指
定した場合のみ)。省略するか0を指定した場合はプリフィクスか
ら基数を... -
Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil (1018.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS... -
Kernel
# check _ signedness(type , headers = nil , opts = nil) { . . . } -> "signed" | "unsigned" | nil (1018.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS... -
Kernel
# check _ sizeof(type , headers = nil) -> Integer | nil (940.0) -
与えられた型のサイズを返します。
与えられた型のサイズを返します。
型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DSIZEOF_type=X" を追加し、型のサイズを返します。型 type がシステムに
存在しない場合は、nil を返します。
例えば、
require 'mkmf'
check_sizeof('mystruct') # => 12
である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロをコンパイラに渡します。
@param type 検査したい型を指定します。
@param headers 追加のヘッダファイルを指定します。 -
Kernel
# check _ sizeof(type , headers = nil) { . . . } -> Integer | nil (940.0) -
与えられた型のサイズを返します。
与えられた型のサイズを返します。
型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DSIZEOF_type=X" を追加し、型のサイズを返します。型 type がシステムに
存在しない場合は、nil を返します。
例えば、
require 'mkmf'
check_sizeof('mystruct') # => 12
である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロをコンパイラに渡します。
@param type 検査したい型を指定します。
@param headers 追加のヘッダファイルを指定します。 -
Kernel
# try _ constant(const , headers = nil , opt = "") -> Integer | nil (940.0) -
定数 const がシステムに存在するかどうか検査します。 Kernel#have_const を使ってください。
...定数 const がシステムに存在するかどうか検査します。
Kernel#have_const を使ってください。
@param const C 言語の定数名を指定します。
@param headers 追加のヘッダファイルを指定します。
@param opt コンパイラに渡すオプションを... -
Kernel
# try _ constant(const , headers = nil , opt = "") { . . . } -> Integer | nil (940.0) -
定数 const がシステムに存在するかどうか検査します。 Kernel#have_const を使ってください。
...定数 const がシステムに存在するかどうか検査します。
Kernel#have_const を使ってください。
@param const C 言語の定数名を指定します。
@param headers 追加のヘッダファイルを指定します。
@param opt コンパイラに渡すオプションを... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) (760.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... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) { . . . } (760.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... -
Kernel
. # fork -> Integer | nil (664.0) -
fork(2) システムコールを使ってプロセスの複製を作 ります。親プロセスでは子プロセスのプロセスIDを、子プロセスでは nil を返します。ブロックを指定して呼び出した場合には、生成し た子プロセスでブロックを評価します。
...puts "parent process. pid: #{Process.pid}, child pid: #{child_pid}"
# => parent process. pid: 79055, child pid: 79602
# 親プロセスでの処理
# ...
# 子プロセスの終了を待って終了。
Process.waitpid(child_pid)
//}
@see IO.popen,IO.pipe,Kernel.#at_exit,Kernel.#exit!, fork(2)... -
Kernel
. # fork { . . . } -> Integer | nil (664.0) -
fork(2) システムコールを使ってプロセスの複製を作 ります。親プロセスでは子プロセスのプロセスIDを、子プロセスでは nil を返します。ブロックを指定して呼び出した場合には、生成し た子プロセスでブロックを評価します。
...puts "parent process. pid: #{Process.pid}, child pid: #{child_pid}"
# => parent process. pid: 79055, child pid: 79602
# 親プロセスでの処理
# ...
# 子プロセスの終了を待って終了。
Process.waitpid(child_pid)
//}
@see IO.popen,IO.pipe,Kernel.#at_exit,Kernel.#exit!, fork(2)... -
Kernel
. # test(cmd , file) -> bool | Time | Integer | nil (664.0) -
単体のファイルでファイルテストを行います。
単体のファイルでファイルテストを行います。
@param cmd 以下に示す文字リテラル、文字列、あるいは同じ文字を表す数値
です。文字列の場合はその先頭の文字だけをコマンドとみなします。
@param file テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@return 下表に特に明記していないものは、真偽値を返します。
以下は cmd として指定できる文字リテラルとその意味です。
: ?r
ファイルを実効 uid で読むことができる
: ?w
ファイルに実効 uid で書くことができる
: ?x
ファイルを... -
Kernel
. # rand(range) -> Integer | Float | nil (649.0) -
擬似乱数を発生させます。
...を、少なくとも片方が実数の場合は実数を返します。
range に含まれる数が無い場合は nil を返します。
まだ Kernel.#srand が呼ばれていなければ自動的に呼び出します。
擬似乱数生成器として Random::DEFAULT を使用します。
こ......10) #=> 1 (0 から 9 までの整数。終端を含まない)
rand(1.0..1.5) #=> 1.1362963047752432 (1.0 以上 1.5 以下の実数)
rand(1.0...1.5) #=> 1.1382321275715483 (1.0 以上 1.5 未満の実数)
rand(1..0) #=> nil
//}
@see Kernel.#srand, Random#rand, Random... -
Kernel
. # spawn(env , program , *args , options={}) -> Integer (406.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...din), 1(stdout), 2(stderr) 以外の
ファイルデスクリプタをすべて閉じます。
false がデフォルトです。
: :exception
Kernel.#system のみで指定できます。
これを true に設定すると、nil や false を返す代わりに例外が発生します。
fa......列を指定します。
@param options オプションパラメータ Hash
@raise ArgumentError 第一引数が配列かつ要素数が 2 でない場合に発生します。
@raise Errno::EXXX コマンドが実行できなかった場合に発生します。
@see Kernel.#system,Kernel.#exec... -
Kernel
. # spawn(program , *args) -> Integer (406.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...din), 1(stdout), 2(stderr) 以外の
ファイルデスクリプタをすべて閉じます。
false がデフォルトです。
: :exception
Kernel.#system のみで指定できます。
これを true に設定すると、nil や false を返す代わりに例外が発生します。
fa......列を指定します。
@param options オプションパラメータ Hash
@raise ArgumentError 第一引数が配列かつ要素数が 2 でない場合に発生します。
@raise Errno::EXXX コマンドが実行できなかった場合に発生します。
@see Kernel.#system,Kernel.#exec... -
Kernel
. # Rational(x , y = 1 , exception: true) -> Rational | nil (361.0) -
引数を有理数(Rational)に変換した結果を返します。
...スコアで繋いだ形式
"1.2/3" のように、分子を実数にする事も可能ですが、分母には指定できませ
ん。また、Kernel.#Integer とは違い "0x10" のような進数を表す接頭
辞を含めた指定は行えません。
//emlist[例][ruby]{
Rational("1/3")... -
Kernel
. # rand(max = 0) -> Integer | Float (349.0) -
擬似乱数を発生させます。
...を、少なくとも片方が実数の場合は実数を返します。
range に含まれる数が無い場合は nil を返します。
まだ Kernel.#srand が呼ばれていなければ自動的に呼び出します。
擬似乱数生成器として Random::DEFAULT を使用します。
こ......10) #=> 1 (0 から 9 までの整数。終端を含まない)
rand(1.0..1.5) #=> 1.1362963047752432 (1.0 以上 1.5 以下の実数)
rand(1.0...1.5) #=> 1.1382321275715483 (1.0 以上 1.5 未満の実数)
rand(1..0) #=> nil
//}
@see Kernel.#srand, Random#rand, Random... -
Kernel
. # BigDecimal(s , exception: true) -> BigDecimal | nil (346.0) -
引数で指定した値を表す BigDecimal オブジェクトを生成します。
引数で指定した値を表す BigDecimal オブジェクトを生成します。
@param s 数値を表現する初期値を文字列、Integer、
Float、Rational、BigDecimal オブジェクトのい
ずれかで指定します。
文字列中のスペースは無視されます。また、判断できない文字が出現
した時点で文字列は終了したものとみなされます。
@param n 必要な有効桁数(self の最大有効桁数)を整数で指定します。 n が
0 または省略されたときは、n の値は s の有効桁数とみなされます。... -
Kernel
. # BigDecimal(s , n , exception: true) -> BigDecimal | nil (346.0) -
引数で指定した値を表す BigDecimal オブジェクトを生成します。
引数で指定した値を表す BigDecimal オブジェクトを生成します。
@param s 数値を表現する初期値を文字列、Integer、
Float、Rational、BigDecimal オブジェクトのい
ずれかで指定します。
文字列中のスペースは無視されます。また、判断できない文字が出現
した時点で文字列は終了したものとみなされます。
@param n 必要な有効桁数(self の最大有効桁数)を整数で指定します。 n が
0 または省略されたときは、n の値は s の有効桁数とみなされます。... -
Kernel
. # spawn(command , options={}) -> Integer (331.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。
@raise Errno::EXXX コマンドが実行できなかった場合に発生します。
@see Kernel.#system,Kernel.#exec... -
Kernel
. # spawn(env , command , options={}) -> Integer (331.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。
@raise Errno::EXXX コマンドが実行できなかった場合に発生します。
@see Kernel.#system,Kernel.#exec... -
Kernel
. # test(cmd , file1 , file2) -> bool (19.0) -
2ファイル間のファイルテストを行います。
2ファイル間のファイルテストを行います。
@param cmd 以下に示す文字リテラル、文字列、あるいは同じ文字を表す数値
です。文字列の場合はその先頭の文字だけをコマンドとみなします。
@param file1 テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@param file2 テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@return 真偽値を返します。
以下は cmd として指定できる文字リテラルとその意味です。
: ?=
ファイル1とファイル2の最終更新時刻が等しい
: ?>
フ...