793件ヒット
[1-100件を表示]
(0.026秒)
クラス
-
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)
- CMath (18)
- Enumerable (11)
- Kernel (33)
- Math (55)
キーワード
- % (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)
- Rational (11)
- Ruby用語集 (11)
- acosh (11)
- asinh (11)
- at (36)
- bigdecimal (11)
-
bigdecimal
/ util (11) - bsearch (22)
- call (11)
- cos! (6)
- divmod (11)
-
enum
_ for (22) - fiddle (11)
- format (11)
- frexp (11)
- gamma (11)
- hypot (11)
- inspect (11)
- lazy (11)
- mathn (4)
- new (25)
- on (132)
-
parse
_ csv (11) - pow (22)
- realtime (11)
- round (20)
-
ruby 1
. 6 feature (11) - sin! (6)
- split (11)
- sprintf (11)
- sprintf フォーマット (11)
- tan! (6)
-
to
_ enum (22) -
to
_ f (22) -
to
_ s (11) - セキュリティモデル (11)
- 正規表現 (11)
検索結果
先頭5件
-
Float
# *(other) -> Float (27207.0) -
算術演算子。積を計算します。
...算術演算子。積を計算します。
@param other 二項演算の右側の引数(対象)
//emlist[例][ruby]{
# 積
2.4 * 3 # => 7.2
//}... -
Rational
# *(other) -> Rational | Float (18237.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/8)
//}... -
Bignum
# *(other) -> Fixnum | Bignum | Float (18201.0) -
算術演算子。積を計算します。
算術演算子。積を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果 -
Fixnum
# *(other) -> Fixnum | Bignum | Float (18201.0) -
算術演算子。積を計算します。
算術演算子。積を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果 -
Benchmark
:: Tms # *(x) -> Benchmark :: Tms (18106.0) -
self と x の乗算を計算します。
...self と x の乗算を計算します。
@param x Benchmark::Tms のオブジェクトか Float に暗黙の変換ができるオブジェクトです。
@return 計算結果は新しい Benchmark::Tms オブジェクトです。
@see Benchmark::Tms#memberwise... -
Float
# **(other) -> Float (15207.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
//}... -
Float
# round(ndigits = 0) -> Integer | Float (9138.0) -
自身ともっとも近い整数もしくは実数を返します。
...方を指定します。
サポートされている値は以下の通りです。
* :up or nil: 0から遠い方に丸められます。
* :even: もっとも近い偶数に丸められます。
* :down: 0に近い方に丸められます。
@return 指定された引数に応じて、.......round # => -1
(-1.5).round # => -2
t = Math::PI # => 3.141592653589793
t.round(3) # => 3.142
t.round(0) # => 3
t.round(1) # => 3.1
t = t**10 # => 93648.04747608298
t.round(-0) # => 93648
t.round(-1) # => 93650
t.round(-2) # => 93600
t.round(-3) # => 94000
t.round(-100)......# => 0
2.5.round(half: :up) # => 3
2.5.round(half: :even) # => 2
2.5.round(half: :down) # => 2
3.5.round(half: :up) # => 4
3.5.round(half: :even) # => 4
3.5.round(half: :down) # => 3
//}
@see Float#ceil, Float#floor, Float#truncate... -
Float
# round(ndigits = 0 , half: :up) -> Integer | Float (9138.0) -
自身ともっとも近い整数もしくは実数を返します。
...方を指定します。
サポートされている値は以下の通りです。
* :up or nil: 0から遠い方に丸められます。
* :even: もっとも近い偶数に丸められます。
* :down: 0に近い方に丸められます。
@return 指定された引数に応じて、.......round # => -1
(-1.5).round # => -2
t = Math::PI # => 3.141592653589793
t.round(3) # => 3.142
t.round(0) # => 3
t.round(1) # => 3.1
t = t**10 # => 93648.04747608298
t.round(-0) # => 93648
t.round(-1) # => 93650
t.round(-2) # => 93600
t.round(-3) # => 94000
t.round(-100)......# => 0
2.5.round(half: :up) # => 3
2.5.round(half: :even) # => 2
2.5.round(half: :down) # => 2
3.5.round(half: :up) # => 4
3.5.round(half: :even) # => 4
3.5.round(half: :down) # => 3
//}
@see Float#ceil, Float#floor, Float#truncate... -
Float
# divmod(other) -> [Numeric] (9030.0) -
self を other で割った商 q と余り r を、 [q, r] という 2 要素の配列にして返します。 商 q は常に整数ですが、余り r は整数であるとは限りません。
...余り r は整数であるとは限りません。
ここで、商 q と余り r は、
* self == other * q + r
と
* other > 0 のとき: 0 <= r < other
* other < 0 のとき: other < r <= 0
* q は整数
をみたす数です。
このメソッドは、メソッド / と % によ... -
Kernel
. # Float(arg) -> Float (6398.0) -
引数を浮動小数点数(Float)に変換した結果を返します。
...引数を浮動小数点数(Float)に変換した結果を返します。
引数が数値の場合は素直に変換し、文字列の場合
は整数や浮動小数点数と見なせるもののみ変換します。
メソッド Float は文字列に対し String#to_f よりも厳密な変換を......例][ruby]{
p Float(4) #=> 4.0
p Float(4_000) #=> 4000.0
p Float(9.88) #=> 9.88
p Float(Time.gm(1986)) #=> 504921600.0
p Float(Object.new) # can't convert Object into Float (TypeError)
p Float(nil) # can't convert nil into Float (TypeError)
p Float("10")......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... -
Kernel
. # Float(arg , exception: true) -> Float | nil (6398.0) -
引数を浮動小数点数(Float)に変換した結果を返します。
...引数を浮動小数点数(Float)に変換した結果を返します。
引数が数値の場合は素直に変換し、文字列の場合
は整数や浮動小数点数と見なせるもののみ変換します。
メソッド Float は文字列に対し String#to_f よりも厳密な変換を......例][ruby]{
p Float(4) #=> 4.0
p Float(4_000) #=> 4000.0
p Float(9.88) #=> 9.88
p Float(Time.gm(1986)) #=> 504921600.0
p Float(Object.new) # can't convert Object into Float (TypeError)
p Float(nil) # can't convert nil into Float (TypeError)
p Float("10")......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... -
struct RFloat * RFLOAT(VALUE obj) (6300.0)
-
-
Rational
# **(other) -> Rational | Float (6219.0) -
冪(べき)乗を計算します。
...r に Float を指定した場合は、計算結果を Float で返しま
す。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
//}...