るりまサーチ

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

別のキーワード

  1. _builtin float
  2. float to_d
  3. float rationalize
  4. json float
  5. fiddle type_float

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 > >>

Float#numerator -> Integer (33319.0)

自身を Rational に変換した時の分子を返します。

...自身を Rational に変換した時の分子を返します。

@return 分子を返します。

//emlist[例][ruby]{
2.0.numerator # => 2
0.5.numerator # => 1
//}

@see Float#denominator...

Numeric#numerator -> Integer (27331.0)

自身を Rational に変換した時の分子を返します。

...自身を Rational に変換した時の分子を返します。

@return 分子を返します。


@see Numeric#denominator、Integer#numeratorFloat#numerator、Rational#numerator、Complex#numerator...

Float#denominator -> Integer (15112.0)

自身を Rational に変換した時の分母を返します。

...自身を Rational に変換した時の分母を返します。

@return 分母を返します。

//emlist[例][ruby]{
2.0.denominator # => 1
0.5.denominator # => 2
//}

@see Float#numerator...

Enumerator::Lazy#enum_for(method = :each, *args) -> Enumerator::Lazy (12306.0)

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

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

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
E
numerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が...
...o_enum は
素のEnumerator ではなく 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...
...n.times { yield *val }
e
nd
e
lse
to_enum(:repeat, n)
e
nd
e
nd
e
nd

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 の返り...

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

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

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

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
E
numerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が...
...o_enum は
素のEnumerator ではなく 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...
...n.times { yield *val }
e
nd
e
lse
to_enum(:repeat, n)
e
nd
e
nd
e
nd

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 の返り...

絞り込み条件を変える

Enumerator::Lazy#to_enum(method = :each, *args) -> Enumerator::Lazy (12306.0)

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

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

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
E
numerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が...
...o_enum は
素のEnumerator ではなく 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...
...n.times { yield *val }
e
nd
e
lse
to_enum(:repeat, n)
e
nd
e
nd
e
nd

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 の返り...

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

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

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

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
E
numerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が...
...o_enum は
素のEnumerator ではなく 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...
...n.times { yield *val }
e
nd
e
lse
to_enum(:repeat, n)
e
nd
e
nd
e
nd

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 の返り...

Enumerator#size -> Integer | Float::INFINITY | nil (9213.0)

self の要素数を返します。

...elf の要素数を返します。

要素数が無限の場合は Float::INFINITY を返します。
E
numerator.new に Proc オブジェクトを指定していた場合はその
実行結果を返します。呼び出した時に要素数が不明であった場合は nil を返し
ます。

//e...
...mlist[例][ruby]{
(1..100).to_a.permutation(4).size # => 94109400
loop.size # => Float::INFINITY
(1..100).drop_while.size # => nil
//}

@see Enumerator.new...

Enumerator::Lazy#grep(pattern) {|item| ... } -> Enumerator::Lazy (9212.0)

Enumerable#grep と同じですが、配列ではなくEnumerator::Lazy を返します。

...
E
numerable#grep と同じですが、配列ではなくEnumerator::Lazy を返します。

//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep(/\A(\d)\1+\z/)>
(100..Float::INFINIT...
...Y).lazy.map(&:to_s).grep(/\A(\d)\1+\z/).take(10).force
# => ["111", "222", "333", "444", "555", "666", "777", "888", "999", "1111"]
//}

@see Enumerable#grep...
...Y).lazy.map(&:to_s).grep(/\A(\d)\1+\z/).take(10).force
# => ["111", "222", "333", "444", "555", "666", "777", "888", "999", "1111"]
//}

@see Enumerable#grep, Enumerable#grep_v, Enumerator::Lazy#grep_v...

Enumerator::Lazy#grep_v(pattern) {|item| ... } -> Enumerator::Lazy (9212.0)

Enumerable#grep_v と同じですが、配列ではなくEnumerator::Lazy を返します。

...
E
numerable#grep_v と同じですが、配列ではなくEnumerator::Lazy を返します。

//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep_v(/(\d).*\1/)>
(100..Float::INFINIT...
...Y).lazy.map(&:to_s).grep_v(/(\d).*\1/).take(15).force
# => ["102", "103", "104", "105", "106", "107", "108", "109", "120", "123", "124", "125", "126", "127", "128"]
//}

@see Enumerable#grep_v, Enumerable#grep, Enumerator::Lazy#grep...

絞り込み条件を変える

<< 1 2 3 > >>