るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

Integer#^(other) -> Integer (27214.0)

ビット二項演算子。排他的論理和を計算します。

...ビット二項演算子。排他的論理和を計算します。

@param other 数値

//emlist[][ruby]{
1 ^ 1 # => 0
2 ^ 3 # => 1
//}...

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...
...
//}

: ネットワークバイトオーダの signed long
//emlist[][ruby]{
s = "\xFF\xFF\xFF\xFE"
n = s.unpack("N")[0]
if n[31] == 1
n = -((n ^ 0xffff_ffff) + 1)
end
n # => -2
//}

: ネットワークバイトオーダの signed long(その2)
//emlist[][ruby]{
s = "\xFF\xFF\xFF\xFE"
n = s.u...

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...
...
//}

: ネットワークバイトオーダの signed long
//emlist[][ruby]{
s = "\xFF\xFF\xFF\xFE"
n = s.unpack("N")[0]
if n[31] == 1
n = -((n ^ 0xffff_ffff) + 1)
end
n # => -2
//}

: ネットワークバイトオーダの signed long(その2)
//emlist[][ruby]{
s = "\xFF\xFF\xFF\xFE"
n = s.u...

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...
...
//}

: ネットワークバイトオーダの signed long
//emlist[][ruby]{
s = "\xFF\xFF\xFF\xFE"
n = s.unpack("N")[0]
if n[31] == 1
n = -((n ^ 0xffff_ffff) + 1)
end
n # => -2
//}

: ネットワークバイトオーダの signed long(その2)
//emlist[][ruby]{
s = "\xFF\xFF\xFF\xFE"
n = s.u...