341件ヒット
[301-341件を表示]
(0.016秒)
別のキーワード
ライブラリ
- ビルトイン (315)
-
bigdecimal
/ util (11) -
json
/ add / rational (11) - mathn (4)
キーワード
- * (11)
- ** (15)
- + (11)
- - (11)
- -@ (8)
-
/ (11) - <=> (11)
- == (11)
- abs (8)
- ceil (11)
- coerce (11)
- convert (11)
- denominator (11)
- fdiv (11)
- floor (11)
- hash (11)
- inspect (11)
- magnitude (8)
-
marshal
_ dump (11) - negative? (8)
- numerator (11)
- positive? (8)
- quo (11)
- rationalize (11)
- round (11)
-
to
_ d (11) -
to
_ f (11) -
to
_ i (11) -
to
_ json (11) -
to
_ r (11) -
to
_ s (11) - truncate (11)
検索結果
先頭5件
-
Rational
# to _ json(*args) -> String (21020.0) -
自身を JSON 形式の文字列に変換して返します。
...JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 使用しません。
//emlist[例][ruby]{
require 'json/add/rational'
Rational(1, 3).to_json # => "{\"json_class\":\"Rational\",\"n\":1,\"d\":3}"
//}
@see JSON::Generator::GeneratorMethods::Hash#to_json......@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json
に渡されます。
//emlist[例][ruby]{
require 'json/add/rational'
Rational(1, 3).to_json # => "{\"json_class\":\"Rational\",\"n\":1,\"d\":3}"
//}
@see JSON::Generator::GeneratorMethods::Hash#to_json... -
Rational
# **(rhs) -> Numeric (21014.0) -
@todo
...@todo
self のべき乗を返します。 Rational になるようであれば Rational で返します。... -
Rational
# coerce(other) -> Array (21014.0) -
自身と other が同じクラスになるよう、自身か other を変換し [other, self] という 配列にして返します。
...other が同じクラスになるよう、自身か other を変換し [other, self] という
配列にして返します。
@param other 比較または変換するオブジェクト
//emlist[例][ruby]{
Rational(1).coerce(2) # => [(2/1), (1/1)]
Rational(1).coerce(2.2) # => [2.2, 1.0]
//}... -
Rational
# to _ d(nFig) -> BigDecimal (21014.0) -
自身を BigDecimal に変換します。
...桁数
@return BigDecimal に変換したオブジェクト
@raise ArgumentError nFig に 0 以下を指定した場合に発生します。
//emlist[][ruby]{
require "bigdecimal"
require "bigdecimal/util"
p Rational(1, 3).to_d(3) # => 0.333e0
p Rational(1, 3).to_d(10) # => 0.3333333333e0
//}... -
Rational
# hash -> Integer (21002.0) -
自身のハッシュ値を返します。
自身のハッシュ値を返します。
@return ハッシュ値を返します。
@see Object#hash