2595件ヒット
[101-200件を表示]
(0.231秒)
クラス
-
ARGF
. class (44) - Array (294)
- BasicObject (66)
- Bignum (6)
- Class (11)
- Complex (44)
- Data (6)
-
Encoding
:: Converter (44) - Enumerator (66)
-
Enumerator
:: Chain (12) -
Enumerator
:: Lazy (109) -
Enumerator
:: Yielder (11) - Exception (11)
- Fiber (17)
- File (11)
- Fixnum (6)
- Float (49)
- Hash (89)
- IO (128)
- Integer (66)
- LocalJumpError (11)
- MatchData (11)
- Method (74)
- Module (245)
- Numeric (55)
- Object (209)
- Proc (105)
- Range (23)
- Rational (33)
- Refinement (3)
- Regexp (22)
- String (267)
- Struct (23)
- Symbol (42)
-
Thread
:: Queue (9) - Time (33)
- UnboundMethod (21)
モジュール
- Enumerable (319)
キーワード
- ! (11)
- % (22)
- ** (50)
- + (11)
- << (12)
- === (29)
- >> (12)
- [] (22)
-
_ _ id _ _ (11) -
_ _ send _ _ (22) - advise (11)
-
alias
_ method (11) - alive? (3)
- append (7)
- arity (33)
- attr (11)
-
attr
_ accessor (11) -
attr
_ reader (11) -
attr
_ writer (11) - backtrace (11)
-
bind
_ call (10) - binmode (11)
- bsearch (44)
- call (33)
- capitalize (16)
- capitalize! (8)
- chain (6)
- chunk (11)
-
class
_ exec (11) - close (9)
- collect (44)
- collect! (22)
-
collect
_ concat (33) - concat (16)
- convert (11)
- count (11)
- crypt (11)
- curry (22)
- delete (11)
- delete! (11)
-
deprecate
_ constant (9) - difference (6)
- div (11)
- divmod (22)
- downcase (16)
- downcase! (8)
- each (56)
-
each
_ with _ index (22) -
each
_ with _ object (22) - encode (33)
-
end
_ with? (16) - entries (11)
-
enum
_ for (44) - except (3)
- extend (11)
-
filter
_ map (15) -
flat
_ map (33) - flock (11)
- force (11)
-
grep
_ v (22) -
import
_ methods (3) - include (11)
- initialize (11)
- insert (11)
- inspect (11)
-
instance
_ exec (11) - intersection (5)
- lazy (11)
- map (44)
- map! (22)
- match (22)
-
max
_ by (44) - merge (12)
- merge! (12)
-
method
_ missing (11) -
module
_ exec (11) -
module
_ function (11) - modulo (11)
- new (11)
- overlap? (1)
- pack (19)
- parameters (22)
- pow (22)
- prepend (26)
-
primitive
_ convert (44) - print (22)
- printf (22)
- private (11)
-
private
_ class _ method (11) -
private
_ constant (11) - product (22)
- protected (11)
- public (11)
-
public
_ class _ method (11) -
public
_ constant (11) -
public
_ send (22) - push (11)
- puts (22)
- read (11)
- readpartial (11)
- reason (11)
- refine (11)
- remainder (11)
-
remove
_ method (11) -
respond
_ to _ missing? (11) - resume (11)
- round (27)
-
ruby2
_ keywords (10) - seek (11)
- send (22)
-
set
_ encoding (22) - slice (7)
- squeeze (11)
- squeeze! (11)
-
start
_ with? (16) - strftime (11)
- sum (38)
- swapcase (16)
- swapcase! (8)
- sysread (11)
- sysseek (11)
- tap (11)
-
to
_ a (22) -
to
_ ary (11) -
to
_ c (11) -
to
_ enum (44) -
to
_ f (22) -
to
_ h (33) -
to
_ hash (11) -
to
_ int (11) -
to
_ io (11) -
to
_ r (11) -
to
_ regexp (11) -
to
_ s (11) -
to
_ str (11) - transfer (3)
-
transform
_ values (16) -
transform
_ values! (16) -
undef
_ method (11) - union (6)
- unpack (11)
- unshift (11)
- upcase (16)
- upcase! (8)
- update (12)
- using (11)
-
values
_ at (44) - with (2)
-
with
_ index (16) -
with
_ object (11) - write (7)
- yield (22)
- zip (66)
検索結果
先頭5件
-
Complex
# **(other) -> Complex (14103.0) -
冪(べき)乗を計算します。
...冪(べき)乗を計算します。
@param other 自身を other 乗する数
//emlist[例][ruby]{
Complex('i') ** 2 # => (-1+0i)
//}... -
Fixnum
# **(other) -> Fixnum | Bignum | Float (14103.0) -
算術演算子。冪(べき乗)を計算します。
...算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1... -
Integer
# **(other) -> Numeric (14103.0) -
算術演算子。冪(べき乗)を計算します。
...elf**other) % modulo と同じ結果を返します。
@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, 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... -
Rational
# **(other) -> Rational | Float (14103.0) -
冪(べき)乗を計算します。
...す。other が有理数であっても、計算結果が無理数だった場合は Float
を返します。
//emlist[例][ruby]{
r = Rational(3, 4)
r ** Rational(2, 1) # => (9/16)
r ** 2 # => (9/16)
r ** 2.0 # => 0.5625
r ** Rational(1, 2) # => 0.866025403784439
//}... -
Integer
# pow(other) -> Numeric (11003.0) -
算術演算子。冪(べき乗)を計算します。
...elf**other) % modulo と同じ結果を返します。
@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, 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 (11003.0) -
算術演算子。冪(べき乗)を計算します。
...elf**other) % modulo と同じ結果を返します。
@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, 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... -
Time
# strftime(format) -> String (8327.0) -
時刻を format 文字列に従って文字列に変換した結果を返します。
...です。
* %A: 曜日の名称(Sunday, Monday ... )
* %a: 曜日の省略名(Sun, Mon ... )
* %B: 月の名称(January, February ... )
* %b: 月の省略名(Jan, Feb ... )
* %C: 世紀 (2009年であれば 20)
* %c: 日付と時刻 (%a %b %e %T %Y)
* %D: 日付 (%m/%d/%y)
* %d: 日......る ( 1..31)
* %F: %Y-%m-%d と同等 (ISO 8601の日付フォーマット)
* %G: ISO 8601の暦週の年
* %g: ISO 8601の暦週の年の下2桁(00-99)
* %H: 24時間制の時(00-23)
* %h: %b と同等
* %I: 12時間制の時(01-12)
* %j: 年中の通算日(001-366)
* %k: 24時間......時。一桁の場合、半角空白で埋める ( 0..23)
* %L: ミリ秒 (000..999)
* %l: 12時間制の時。一桁の場合、半角空白で埋める ( 0..12)
* %M: 分(00-59)
* %m: 月を表す数字(01-12)
* %n: 改行 (\n)
* %N: 秒の小数点以下。桁の指定がない場合... -
Object
# enum _ for(method = :each , *args) {|*args| . . . } -> Enumerator (8241.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n.times { yield *val }
end
end
end
%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'w... -
Object
# to _ enum(method = :each , *args) {|*args| . . . } -> Enumerator (8241.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n.times { yield *val }
end
end
end
%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'w... -
Enumerator
:: Lazy # enum _ for(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (8213.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...if n < 0
if block_given?
each do |*val|
n.times { yield *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]
#... -
Enumerator
:: Lazy # to _ enum(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (8213.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...if n < 0
if block_given?
each do |*val|
n.times { yield *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]
#...