727件ヒット
[1-100件を表示]
(0.133秒)
クラス
-
Benchmark
:: Tms (11) - BigDecimal (11)
- Bignum (6)
- Complex (22)
- Enumerator (14)
-
Enumerator
:: Lazy (44) -
Fiddle
:: Function (22) - Fixnum (6)
- Float (49)
- Integer (48)
- OptionParser (132)
- Range (22)
- Rational (22)
- String (33)
- Time (36)
モジュール
- Benchmark (11)
- Enumerable (11)
- Kernel (33)
- Math (22)
キーワード
- % (11)
- ** (39)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - Float (11)
- Marshal フォーマット (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) - Numeric (11)
- RFLOAT (11)
- Ruby用語集 (11)
- at (36)
- bigdecimal (11)
-
bigdecimal
/ util (11) - bsearch (22)
- call (11)
- divmod (11)
-
enum
_ for (22) - fiddle (11)
- format (11)
- frexp (11)
- gamma (11)
- inspect (11)
- lazy (11)
- new (25)
- on (132)
-
parse
_ csv (11) - pow (22)
- realtime (11)
- round (20)
-
ruby 1
. 6 feature (11) - split (11)
- sprintf (11)
- sprintf フォーマット (11)
-
to
_ enum (22) -
to
_ f (22) -
to
_ s (11) - セキュリティモデル (11)
- 正規表現 (11)
検索結果
先頭5件
-
Float
# *(other) -> Float (27307.0) -
算術演算子。積を計算します。
...算術演算子。積を計算します。
@param other 二項演算の右側の引数(対象)
//emlist[例][ruby]{
# 積
2.4 * 3 # => 7.2
//}... -
Benchmark
:: Tms # *(x) -> Benchmark :: Tms (21206.0) -
self と x の乗算を計算します。
...self と x の乗算を計算します。
@param x Benchmark::Tms のオブジェクトか Float に暗黙の変換ができるオブジェクトです。
@return 計算結果は新しい Benchmark::Tms オブジェクトです。
@see Benchmark::Tms#memberwise... -
Rational
# *(other) -> Rational | Float (18337.0) -
積を計算します。
...します。
@param other 自身に掛ける数
other に Float を指定した場合は、計算結果を Float で返しま
す。
//emlist[例][ruby]{
r = Rational(3, 4)
r * 2 # => (3/2)
r * 4 # => (3/1)
r * 0.5 # => 0.375
r * Rational(1, 2) # => (3... -
Bignum
# *(other) -> Fixnum | Bignum | Float (18301.0) -
算術演算子。積を計算します。
...算術演算子。積を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果... -
Fixnum
# *(other) -> Fixnum | Bignum | Float (18301.0) -
算術演算子。積を計算します。
...算術演算子。積を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果... -
Float
# **(other) -> Float (15307.0) -
算術演算子。冪を計算します。
...算術演算子。冪を計算します。
@param other 二項演算の右側の引数(対象)
//emlist[例][ruby]{
# 冪
1.2 ** 3.0 # => 1.7279999999999998
3.0 + 4.5 - 1.3 / 2.4 * 3 % 1.2 ** 3.0 # => 5.875
0.0 ** 0 # => 1.0
//}... -
Kernel
. # Float(arg , exception: true) -> Float | nil (9510.0) -
引数を浮動小数点数(Float)に変換した結果を返します。
...引数を浮動小数点数(Float)に変換した結果を返します。
引数が数値の場合は素直に変換し、文字列の場合
は整数や浮動小数点数と見なせるもののみ変換します。
メソッド Float は文字列に対し String#to_f よりも厳密な変換を......@param exception false を指定すると、変換できなかった場合、
例外を発生する代わりに nil を返します。
@raise ArgumentError 整数や浮動小数点数と見なせない文字列を引数に指定した場合に発生します。
@raise TypeError nil......p Float(".1") #=> 0.1
p Float("0xa") #=> 10.0
p Float("nan") # invalid value for Float(): "nan" (ArgumentError)
p Float("INF") # invalid value for Float(): "INF" (ArgumentError)
p Float("-Inf") # invalid value for Float(): "-Inf" (ArgumentError)
p Float(("10" * 1... -
Enumerator
:: Lazy # enum _ for(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (9416.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......umerator ではなく 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 |*v......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]
# Lazy#to_enum のおかげで、repeat の返り... -
Enumerator
:: Lazy # to _ enum(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (9416.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......umerator ではなく 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 |*v......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]
# Lazy#to_enum のおかげで、repeat の返り... -
Kernel
. # Float(arg) -> Float (9410.0) -
引数を浮動小数点数(Float)に変換した結果を返します。
...引数を浮動小数点数(Float)に変換した結果を返します。
引数が数値の場合は素直に変換し、文字列の場合
は整数や浮動小数点数と見なせるもののみ変換します。
メソッド Float は文字列に対し String#to_f よりも厳密な変換を......行います。
@param arg 変換対象のオブジェクトです。
@raise ArgumentError 整数や浮動小数点数と見なせない文字列を引数に指定した場合に発生します。
@raise TypeError nil またはメソッド to_f を持たないオブジェクトを引数に指定し......p Float(".1") #=> 0.1
p Float("0xa") #=> 10.0
p Float("nan") # invalid value for Float(): "nan" (ArgumentError)
p Float("INF") # invalid value for Float(): "INF" (ArgumentError)
p Float("-Inf") # invalid value for Float(): "-Inf" (ArgumentError)
p Float(("10" * 1... -
Enumerator
:: Lazy # enum _ for(method = :each , *args) -> Enumerator :: Lazy (9316.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......umerator ではなく 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 |*v......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]
# Lazy#to_enum のおかげで、repeat の返り... -
Enumerator
:: Lazy # to _ enum(method = :each , *args) -> Enumerator :: Lazy (9316.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......umerator ではなく 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 |*v......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]
# Lazy#to_enum のおかげで、repeat の返り...