るりまサーチ

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

別のキーワード

  1. _builtin size
  2. _builtin size?
  3. net/imap size
  4. rexml/document size
  5. file size

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

Vector.zero(size) -> Vector (18214.0)

零ベクトルを返します。

...零ベクトルを返します。

//emlist[例][ruby]{
require 'matrix'
Vector.zero(3) # => Vector[0, 0, 0]
//}

@param size ベクトルの次元...

FileTest.#size(file) -> Integer (18119.0)

ファイルのサイズを返します。

...しない場合、あるいはシステムコールに失敗した場合に発生します。

@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。

@see FileTest.#size?, FileTest.#zero?

例:
FileTest.size('/etc/passwd') # => 5925...

FileTest.#zero?(file) -> bool (6137.0)

ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。

...された IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例:][ruby]{
IO.write("zero.txt", "")
FileTest.zero?("zero.txt") # => true
IO.write("nonzero.txt", "1")
FileTest.zero?("nonzero.txt") # => false
//}

@see FileTest.#size, FileTest.#size?...

FileTest.#size?(file) -> Integer | nil (6125.0)

ファイルのサイズを返します。ファイルが存在しない時や ファイルのサイズが0の時には nil を返します。

...定された IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "test")
FileTest.size?("testfile") # => 4
File.delete("testfile")
FileTest.size?("testfile") # => nil
//}

@see FileTest.#size, FileTest.#zero?...

FileTest.#zero?(file) -> bool (3137.0)

ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。

...された IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例:][ruby]{
IO.write("zero.txt", "")
FileTest.zero?("zero.txt") # => true
IO.write("nonzero.txt", "1")
FileTest.zero?("nonzero.txt") # => false
//}

@see FileTest.#size, FileTest.#size?...

絞り込み条件を変える

LUSolve.#lusolve(a, b, ps, zero = 0.0) -> [BigDecimal] (149.0)

LU 分解を用いて、連立1次方程式 Ax = b の解 x を求めて返します。

...す。

@param zero 0.0 を表す値を指定します。

//emlist[][ruby]{
require 'bigdecimal'
require 'bigdecimal/util'
require 'bigdecimal/ludcmp'

include LUSolve

a = [['1.0', '2.0'], ['3.0', '1.0']].flatten.map(&:to_d)
# x = ['1.0', -1.0']
b = ['-1.0', '2.0'].map(&:to_d)

zero
= '0.0'.to_d
o...
...ne = '1.0'.to_d
# 以下の 2 行は
ps = ludecomp(a, b.size, zero, one) # a が破壊的に変更される
x = lusolve(a, b, ps, zero)
# こう書いてもよい
# x = lusolve(a, b, ludecomp(a, b.size, zero, one), zero)

p x.map(&:to_f) #=> [1.0, -1.0]
//}...

FileTest.#empty?(file) -> bool (37.0)

ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。

...された IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例:][ruby]{
IO.write("zero.txt", "")
FileTest.zero?("zero.txt") # => true
IO.write("nonzero.txt", "1")
FileTest.zero?("nonzero.txt") # => false
//}

@see FileTest.#size, FileTest.#size?...

NEWS for Ruby 3.0.0 (24.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...eql? are now defined and will return true for separate Proc instances if the procs were created from the same block. 14267
* Queue / SizedQueue
* Queue#pop, SizedQueue#push and related methods may now invoke the `block`/`unblock` scheduler hooks in a non-blocking context. 16786
* Ractor...
...osed pipe, no broken pipe error message will be shown now. 14413
* `TRUE`/`FALSE`/`NIL` constants are no longer defined.
* Integer#zero? overrides Numeric#zero? for optimization. 16961
* Enumerable#grep and Enumerable#grep_v when passed a Regexp and no block no longer modify Regexp.last_matc...
...* Microarchitectural optimizations
* Native functions shared by multiple methods are deduplicated on JIT compaction.
* Decrease code size of hot paths by some optimizations and partitioning cold paths.
* Instance variables
* Eliminate some redundant checks.
* Skip...

Array#pack(template) -> String (18.0)

配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。

..."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) # 非正規化数 (denormalized number)
end
elsif exp == 255
if fra == 0
sgn * Inf...
..."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-52) # 非正規化数 (denormalized number)
end
elsif exp == 2047
if fra == 0
sgn * Inf...
...'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"

"127.0.0.1".split(".").collect {|c| c.to_i}.pack("C4")
# => "\x7F\x00\x00\x01"
//}

: sockaddr_in...

Array#pack(template, buffer: String.new) -> String (18.0)

配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。

..."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) # 非正規化数 (denormalized number)
end
elsif exp == 255
if fra == 0
sgn * Inf...
..."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-52) # 非正規化数 (denormalized number)
end
elsif exp == 2047
if fra == 0
sgn * Inf...
...'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"

"127.0.0.1".split(".").collect {|c| c.to_i}.pack("C4")
# => "\x7F\x00\x00\x01"
//}

: sockaddr_in...

絞り込み条件を変える

String#unpack(template) -> Array (18.0)

Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。

..."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) # 非正規化数 (denormalized number)
end
elsif exp == 255
if fra == 0
sgn * Inf...
..."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-52) # 非正規化数 (denormalized number)
end
elsif exp == 2047
if fra == 0
sgn * Inf...
...'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"

"127.0.0.1".split(".").collect {|c| c.to_i}.pack("C4")
# => "\x7F\x00\x00\x01"
//}

: sockaddr_in...
<< 1 2 > >>