153件ヒット
[101-153件を表示]
(0.057秒)
ライブラリ
- ビルトイン (33)
- fiddle (84)
-
fiddle
/ import (12) - strscan (24)
クラス
- Array (21)
-
Fiddle
:: Function (12) -
Fiddle
:: Pointer (72) - String (12)
- StringScanner (24)
モジュール
-
Fiddle
:: Importer (12)
検索結果
先頭5件
-
Fiddle
:: Function # call(*args) -> Integer|DL :: CPtr|nil (120.0) -
関数を呼び出します。
...引数の変換は以下の通りです。
: void* (つまり任意のポインタ型)
nil ならば C の NULL に変換されます
Fiddle::Pointer は保持している C ポインタに変換されます。
文字列であればその先頭ポインタになります。
IO オブジェ......ます。
整数であればそれがアドレスとみなされます。
to_ptr を持っているならば、それを呼びだし Fiddle::Pointer に
変換したものを用います。
to_i を持っているならば、それを呼びだし結果の整数を
アドレスと見なし......。
: void
nil を返します
: (unsigned) char/short/int/long/long long
C の整数を Ruby の整数に変換します
: void*(つまり任意のポインタ型)
C のポインタを保持した Fiddle::Pointer を返します。
@param args 関数の引数
@see Fiddle::Function.new... -
Fiddle
:: Importer # sizeof(t) -> Integer (108.0) -
C における sizeof(t) の値を返します。
...の場合、t が to_ptr というインスタンスメソッドを持っている
ならば t.size を返します。
それ以外の場合は Pointer[t].size を返します。
@param t サイズを計算する対象
@raise Fiddle::DLError t として文字列を渡し、それが表している... -
Array
# pack(template) -> String (31.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...] # 仮数部
//}
そして、s, e, f の意味は以下の通りです。
//emlist[][ruby]{
sgn = s == "0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-126-23......,52] # 仮数部
//}
そして、s, e, f の意味は以下の通りです。
//emlist[][ruby]{
sgn = s == "0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-1022-5......きません。
//emlist[][ruby]{
["foo"].pack("p").unpack("p") # => ["foo"]
"xp\xC2\x85\vV\x00\x00".unpack("p")
# => ArgumentError: no associated pointer
//}
"p" や "P" は、nil を特別に扱い NULL
ポインタとして解釈します。(以下は、64bitマシンで一般的な結果)
//... -
Array
# pack(template , buffer: String . new) -> String (31.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...] # 仮数部
//}
そして、s, e, f の意味は以下の通りです。
//emlist[][ruby]{
sgn = s == "0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-126-23......,52] # 仮数部
//}
そして、s, e, f の意味は以下の通りです。
//emlist[][ruby]{
sgn = s == "0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-1022-5......きません。
//emlist[][ruby]{
["foo"].pack("p").unpack("p") # => ["foo"]
"xp\xC2\x85\vV\x00\x00".unpack("p")
# => ArgumentError: no associated pointer
//}
"p" や "P" は、nil を特別に扱い NULL
ポインタとして解釈します。(以下は、64bitマシンで一般的な結果)
//... -
String
# unpack(template) -> Array (31.0) -
Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。
...] # 仮数部
//}
そして、s, e, f の意味は以下の通りです。
//emlist[][ruby]{
sgn = s == "0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-126-23......,52] # 仮数部
//}
そして、s, e, f の意味は以下の通りです。
//emlist[][ruby]{
sgn = s == "0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-1022-5......きません。
//emlist[][ruby]{
["foo"].pack("p").unpack("p") # => ["foo"]
"xp\xC2\x85\vV\x00\x00".unpack("p")
# => ArgumentError: no associated pointer
//}
"p" や "P" は、nil を特別に扱い NULL
ポインタとして解釈します。(以下は、64bitマシンで一般的な結果)
//...