別のキーワード
ライブラリ
- ビルトイン (4)
- bigdecimal (1)
-
fiddle
/ import (1) - mkmf (2)
クラス
- BigDecimal (1)
- Proc (4)
モジュール
-
Fiddle
:: Importer (1) - Kernel (2)
検索結果
先頭5件
- BigDecimal
# sign -> -3 | -2 | -1 | 0 | 1 | 2 | 3 - Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil - Kernel
# check _ signedness(type , headers = nil , opts = nil) { . . . } -> "signed" | "unsigned" | nil - Fiddle
:: Importer # bind(signature , *opts) { . . . } -> Fiddle :: Function - Proc
# ===(*arg) -> ()
-
BigDecimal
# sign -> -3 | -2 | -1 | 0 | 1 | 2 | 3 (56413.0) -
自身の符号等の性質に応じて、Integer を返します。
自身の符号等の性質に応じて、Integer を返します。
符号が正であれば正の整数を返し、負であれば負の整数を返し、NaN であれば 0 を返します。
NaN であれば、 0。 BigDecimal::SIGN_NaN と同じです。
+0 であれば、 1。 BigDecimal::SIGN_POSITIVE_ZERO と同じです。
-0 であれば、-1。 BigDecimal::SIGN_NEGATIVE_ZERO と同じです。
有限の正の値 であれば、 2。 BigDecimal::SIGN_POSITIVE_FINITE ... -
Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil (19516.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 (19516.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... -
Fiddle
:: Importer # bind(signature , *opts) { . . . } -> Fiddle :: Function (322.0) -
Ruby のブロックを C の関数で wrap し、その関数をモジュールに インポートします。
Ruby のブロックを C の関数で wrap し、その関数をモジュールに
インポートします。
これでインポートされた関数はモジュール関数として定義されます。
また、Fiddle::Importer#[] で Fiddle::Function オブジェクトとして
取り出すことができます。
signature で関数の名前とシネグチャを指定します。例えば
"int compare(void*, void*)" のように指定します。
opts には :stdcall もしくは :cdecl を渡すことができ、
呼出規約を明示することができます。
@return インポートした関数を表す ... -
Proc
# ===(*arg) -> () (130.0) -
手続きオブジェクトを実行してその結果を返します。
手続きオブジェクトを実行してその結果を返します。
引数の渡され方はオブジェクトの生成方法によって異なります。
詳しくは Proc#lambda? を参照してください。
「===」は when の所に手続きを渡せるようにするためのものです。
//emlist[例][ruby]{
def sign(n)
case n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end
p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1... -
Proc
# [](*arg) -> () (130.0) -
手続きオブジェクトを実行してその結果を返します。
手続きオブジェクトを実行してその結果を返します。
引数の渡され方はオブジェクトの生成方法によって異なります。
詳しくは Proc#lambda? を参照してください。
「===」は when の所に手続きを渡せるようにするためのものです。
//emlist[例][ruby]{
def sign(n)
case n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end
p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1... -
Proc
# call(*arg) -> () (130.0) -
手続きオブジェクトを実行してその結果を返します。
手続きオブジェクトを実行してその結果を返します。
引数の渡され方はオブジェクトの生成方法によって異なります。
詳しくは Proc#lambda? を参照してください。
「===」は when の所に手続きを渡せるようにするためのものです。
//emlist[例][ruby]{
def sign(n)
case n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end
p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1... -
Proc
# yield(*arg) -> () (130.0) -
手続きオブジェクトを実行してその結果を返します。
手続きオブジェクトを実行してその結果を返します。
引数の渡され方はオブジェクトの生成方法によって異なります。
詳しくは Proc#lambda? を参照してください。
「===」は when の所に手続きを渡せるようにするためのものです。
//emlist[例][ruby]{
def sign(n)
case n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end
p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1...