るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

キーワード

検索結果

Rake::TestTask#warning -> bool (24234.0)

この値が真である場合、テスト実行時に ruby -w を実行したのと同じ効果が生じます。

...この値が真である場合、テスト実行時に ruby -w を実行したのと同じ効果が生じます。...

Ripper#warning(fmt, *args) -> nil (24234.0)

解析した Ruby プログラムの中に重要な警告($-w が false の時だけ出 力される警告)を出力するようなものがあった場合に実行されます。

...解析した Ruby プログラムの中に重要な警告($-w が false の時だけ出
力される警告)を出力するようなものがあった場合に実行されます。

@param fmt エラーメッセージのフォーマット文字列です。

@param args エラーメッセージのフ...
...ォーマットされる引数です。

サブクラスでオーバライドして使用します。

引数のエラーメッセージは printf フォーマットに従って渡されます。...

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

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

...結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3,...
...になりそうなとき、警告を出したうえで 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) -> Numeric (3131.0)

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

...結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3,...
...になりそうなとき、警告を出したうえで 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 (3131.0)

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

...結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3,...
...になりそうなとき、警告を出したうえで Float::INFINITY を返します。

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

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


@see BigDecimal#power...

絞り込み条件を変える

String#to_f -> Float (3061.0)

文字列を 10 進数表現と解釈して、浮動小数点数 Float に変換します。

...対象とします。
途中に変換できないような文字列がある場合、それより先の文字列は無視されます。

//emlist[][ruby]{
p "-10".to_f # => -10.0
p "10e2".to_f # => 1000.0
p "1e-2".to_f # => 0.01
p ".1".to_f # => 0.1

p "1_0_0".to_f # => 100.0 # 数値リテ...
...字列のケースでも、0.0 を返します。

//emlist[][ruby]{
p "".to_f # => 0.0
p "nan".to_f # => 0.0
p "INF".to_f # => 0.0
p "-Inf".to_f # => 0.0
//}

変換後の Float が有限の値を取れないときは、Float::INFINITY を用います。
このとき、全ての警告を...
...list[][ruby]{
#!ruby -W2

p ("10" * 1000).to_f # => Infinity
# warning: Float 10101010101010101010... out of range
//}

なお、このメソッドとは逆に、数値を文字列に変換するには
Kernel.#sprintf, String#%, Integer#to_s
を使用します。

@see String#hex, String#oct, Stri...

Regexp#~ -> Integer | nil (131.0)

変数 $_ の値との間でのマッチをとります。

...ist[][ruby]{
self =~ $_
//}

//emlist[例][ruby]{
$_ = "hogehoge"

i
f /foo/
puts "match"
else
puts "no match"
end
# => no match
# ただし、警告がでる。warning: regex literal in condition

reg = Regexp.compile("foo")

i
f ~ reg
puts "match"
else
puts "no match"
end
# => no match

i
...
...f reg
puts "match"
else
puts "no match"
end
# => match
# reg は nil でも false でも無いので常にtrue
//}...