るりまサーチ

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

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. module >
  4. integer >
  5. float >

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Numeric#numerator -> Integer (18226.0)

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

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

@return 分子を返します。


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

Rational#numerator -> Integer (18226.0)

分子を返します。

...分子を返します。

@return 分子を返します。

//emlist[例][ruby]{
Rational(7).numerator # => 7
Rational(7, 1).numerator # => 7
Rational(9, -4).numerator # => -9
Rational(-2, -10).numerator # => 1
//}

@see Rational#denominator...

Complex#numerator -> Complex (18214.0)

分子を返します。

...分子を返します。

//emlist[例][ruby]{
Complex('1/2+2/3i').numerator # => (3+4i)
Complex(3).numerator # => (3+0i)
//}

@see Complex#denominator...

Float#numerator -> Integer (18214.0)

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

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

@return 分子を返します。

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

@see Float#denominator...

Integer#numerator -> Integer (18214.0)

分子(常に自身)を返します。

...分子(常に自身)を返します。

@return 分子を返します。

//emlist[][ruby]{
10.numerator # => 10
-10.numerator # => -10
//}

@see Integer#denominator...

絞り込み条件を変える

Enumerator::Lazy#collect {|item| ... } -> Enumerator::Lazy (3207.0)

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

...が、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>

1.step.lazy.collect{ |n|...
...n.succ }.take(10).force
# => [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
//}

@see Enumerable#map...

Enumerator::Lazy#drop_while {|item| ... } -> Enumerator::Lazy (3207.0)

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

...じですが、配列ではなくEnumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.drop_while { |i| i < 42 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop_while>

1.step.lazy.drop_while { |i| i < 42 }.take(10).force
# => [42, 43, 44, 45, 46, 47, 48, 49,...

Enumerator::Lazy#filter {|item| ... } -> Enumerator::Lazy (3207.0)

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

...、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>

1.step.lazy.select...
...{ |i| i.even? }.take(10).force
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}

@see Enumerable#select...

Enumerator::Lazy#filter_map {|item| ... } -> Enumerator::Lazy (3207.0)

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

...配列ではなく Enumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.filter_map { |n| n * 2 if n.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: (1.step)>:filter_map>

1.step.lazy.filter_ma...
...p { |n| n * 2 if n.even? }.take(10).force
# => [4, 8, 12, 16, 20, 24, 28, 32, 36, 40]
//}

@see Enumerable#filter_map...

Enumerator::Lazy#find_all {|item| ... } -> Enumerator::Lazy (3207.0)

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

...、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>

1.step.lazy.select...
...{ |i| i.even? }.take(10).force
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}

@see Enumerable#select...

絞り込み条件を変える

Enumerator::Lazy#map {|item| ... } -> Enumerator::Lazy (3207.0)

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

...が、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>

1.step.lazy.collect{ |n|...
...n.succ }.take(10).force
# => [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
//}

@see Enumerable#map...
<< 1 2 3 ... > >>