るりまサーチ

最速Rubyリファレンスマニュアル検索!
284件ヒット [1-100件を表示] (0.125秒)
トップページ > クエリ:-[x] > クエリ:r[x] > クエリ:*[x] > クエリ:Raise[x] > クエリ:**[x]

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils rm_r
  5. fileutils cp_r

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 > >>

Integer#**(other) -> Numeric (27508.0)

算術演算子。冪(べき乗)を計算します。

...param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@ra...
...ise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -2) # => -1
-
3.pow(3, 8) # => 5
-
3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}

結果が...
...数になりそうなとき、警告を出したうえで Float::INFINITY を返します。

//emlist[計算を放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning: in a**b, b may be too big
# Infinity
//}

判定の閾値は変わりえます。

@see BigDecimal#power...

Matrix#**(n) -> Matrix (27406.0)

self の n 乗を返します。

...self の n 乗を返します。

@param n べき数の指定
@raise ExceptionForMatrix::ErrNotRegular n が 0 以下で、行列が正則でない場合に発生します...

OpenSSL::BN#**(other) -> OpenSSL::BN (24406.0)

自身の other 乗を返します。

...自身の other 乗を返します。

@param other 指数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#mod_exp...

Integer#pow(other) -> Numeric (9308.0)

算術演算子。冪(べき乗)を計算します。

...param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@ra...
...ise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -2) # => -1
-
3.pow(3, 8) # => 5
-
3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}

結果が...
...数になりそうなとき、警告を出したうえで Float::INFINITY を返します。

//emlist[計算を放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning: in a**b, b may be too big
# Infinity
//}

判定の閾値は変わりえます。

@see BigDecimal#power...

Integer#pow(other, modulo) -> Integer (9308.0)

算術演算子。冪(べき乗)を計算します。

...param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@ra...
...ise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -2) # => -1
-
3.pow(3, 8) # => 5
-
3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}

結果が...
...数になりそうなとき、警告を出したうえで Float::INFINITY を返します。

//emlist[計算を放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning: in a**b, b may be too big
# Infinity
//}

判定の閾値は変わりえます。

@see BigDecimal#power...

絞り込み条件を変える

ruby 1.6 feature (8400.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...ruby 1.6 feature
r
uby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。

((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。

== 1.6.8 (2002-12-24) ->...
...printf("%d", nil)

=> -:1:in `sprintf': no implicit conversion from nil (TypeError)
from -:1
r
uby 1.6.7 (2002-03-01) [i586-linux]

=> ruby 1.6.7 (2002-07-30) [i586-linux]
"0"

: 2002-05-23 -* オプション(?)

以前まで、

#! ruby -*-...
...((<ruby-bugs-ja:PR#107>))

END {
p 1
END { p 2 }
}

=> ruby 1.6.5 (2001-09-19) [i586-linux]
1

=> ruby 1.6.5 (2001-11-01) [i586-linux]
1
2

: String#succ

((<ruby-talk:22557>))

p "***".succ
p "*".s...

IO.for_fd(fd, mode = "r", **opts) -> IO (6474.0)

オープン済みのファイルディスクリプタ fd に対する新しい IO オブジェクトを生成して返します。

...ます。
IO.new, IO.for_fd はブロックを受け付けません。

=== キーワード引数
このメソッドは以下のキーワード引数を利用できます。
*
:mode mode引数と同じ意味です
*
:external_encoding 外部エンコーディング。"-" はデフォルト外部...
...別名です。
*
:internal_encoding 内部エンコーディング。"-" はデフォルト内部エンコーディングの
別名です。nilなら変換しません。
*
:encoding "extenc:intenc" の形で外部/内部エンコーディングを指定します。
*
:textmode 真を...
...意味になります。
*
:binmode 真を渡すと mode の "b" と同じ意味になります。
*
:autoclose 偽を渡すと close時/GCでのファイナライザ呼出時に fd を close しません。
また、String#encode で説明されている :invalid => :replace などの
変換オ...
...
*
:binmode 真を渡すと mode の "b" と同じ意味になります。
*
:autoclose 偽を渡すと close時/GCでのファイナライザ呼出時に fd を close しません。
*
:path 文字列を渡すと、IO#path メソッドがその値を返すようになります。
また、Str...

Enumerator::Lazy#enum_for(method = :each, *args) {|*args| block} -> Enumerator::Lazy (6452.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

...Object#to_enum と同じですが、Enumerator::Lazy を返します。

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が...
...merator ではなく Enumerator::Lazy を返すようになっています。

//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise
ArgumentError if n < 0
if block_given?
each do |*va...
... *val }
end
else
to_enum(:repeat, n)
end
end
end

r
= 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

r
= 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

# Lazy#to_enum のおかげで、repeat の返り値は
# もとが Enumer...

IO.read(path, **opt) -> String | nil (6421.0)

path で指定されたファイルを offset 位置から length バイト分読み込んで返します。

..."" を返します。例えば、IO.read(空ファイル) は "" を返します。

引数 length が指定された場合はバイナリ読み込みメソッド、そうでない場合はテキスト読み込みメソッドとして
動作します。

Kernel.#open と同様 path の先頭が "|"...
...出力を読み取ります。

@param path ファイル名を表す文字列か "|コマンド名" を指定します。

@param length 読み込む長さを整数で指定します。nil であるか省略した場合には、EOF まで読み込みます。

@param offset 読み込みを始める...
...

@param opt ファイル path を open する時に使われるオプションをキーワード引数で指定します。

@raise Errno::EXXX path のオープン、offset 位置への設定、ファイルの読み込みに失敗した場合に発生します。

@raise ArgumentError length...

IO.read(path, length = nil, **opt) -> String | nil (6421.0)

path で指定されたファイルを offset 位置から length バイト分読み込んで返します。

..."" を返します。例えば、IO.read(空ファイル) は "" を返します。

引数 length が指定された場合はバイナリ読み込みメソッド、そうでない場合はテキスト読み込みメソッドとして
動作します。

Kernel.#open と同様 path の先頭が "|"...
...出力を読み取ります。

@param path ファイル名を表す文字列か "|コマンド名" を指定します。

@param length 読み込む長さを整数で指定します。nil であるか省略した場合には、EOF まで読み込みます。

@param offset 読み込みを始める...
...

@param opt ファイル path を open する時に使われるオプションをキーワード引数で指定します。

@raise Errno::EXXX path のオープン、offset 位置への設定、ファイルの読み込みに失敗した場合に発生します。

@raise ArgumentError length...

絞り込み条件を変える

<< 1 2 3 > >>