981件ヒット
[201-300件を表示]
(0.105秒)
別のキーワード
ライブラリ
- ビルトイン (696)
- bigdecimal (22)
-
bigdecimal
/ util (11) - date (77)
-
json
/ add / rational (11) - mathn (4)
- matrix (143)
-
net
/ http (6) - stringio (11)
クラス
キーワード
- * (22)
- ** (15)
- + (11)
- - (22)
- -@ (19)
-
/ (21) - <=> (22)
- == (11)
- abs (8)
- ajd (11)
- amjd (11)
- ceil (11)
- coerce (44)
- cofactor (11)
-
cofactor
_ expansion (11) - convert (11)
- denominator (33)
- det (11)
-
det
_ e (11) - determinant (11)
-
determinant
_ e (11) - div (11)
-
elements
_ to _ r (22) - fdiv (11)
- finite? (8)
- floor (11)
- hash (11)
- i (11)
- inspect (11)
-
laplace
_ expansion (11) - magnitude (8)
-
marshal
_ dump (11) - negative? (8)
- nonzero? (11)
- numerator (33)
- offset (11)
- positive? (8)
- putc (11)
- quo (22)
- rand (33)
- rank (11)
- rationalize (99)
- real (11)
- real? (11)
- round (11)
-
sec
_ fraction (11) -
second
_ fraction (11) - subsec (11)
-
to
_ c (11) -
to
_ d (11) -
to
_ f (11) -
to
_ i (11) -
to
_ int (11) -
to
_ json (11) -
to
_ r (88) -
to
_ s (11) - tr (11)
- trace (11)
- truncate (11)
-
write
_ timeout= (6)
検索結果
先頭5件
-
Rational
# ==(other) -> bool (9037.0) -
数値として等しいか判定します。
...なければ false を返します。
//emlist[例][ruby]{
Rational(2, 3) == Rational(2, 3) # => true
Rational(5) == 5 # => true
Rational(0) == 0.0 # => true
Rational('1/3') == 0.33 # => false
Rational('1/2') == '1/2' # => false
//}......でなければ false を返します。
//emlist[例][ruby]{
Rational(2, 3) == Rational(2, 3) # => true
Rational(5) == 5 # => true
Rational(0) == 0.0 # => true
Rational('1/3') == 0.33 # => false
Rational('1/2') == '1/2' # => false
//}... -
Rational
# denominator -> Integer (9031.0) -
分母を返します。常に正の整数を返します。
...分母を返します。常に正の整数を返します。
@return 分母を返します。
//emlist[例][ruby]{
Rational(7).denominator # => 1
Rational(7, 1).denominator # => 1
Rational(9, -4).denominator # => 4
Rational(-2, -10).denominator # => 5
//}
@see Rational#numerator... -
Rational
# fdiv(other) -> Float (9031.0) -
self を other で割った商を Float で返します。 other に虚数を指定することは出来ません。
...@param other 自身を割る数
//emlist[例][ruby]{
Rational(2, 3).fdiv(1) # => 0.6666666666666666
Rational(2, 3).fdiv(0.5) # => 1.3333333333333333
Rational(2).fdiv(3) # => 0.6666666666666666
Rational(1).fdiv(Complex(1, 0)) # => 1.0
Rational(1).fdiv(Complex(0, 1)) # => RangeError
//}... -
Rational
# inspect -> String (9031.0) -
自身を人間が読みやすい形の文字列表現にして返します。
...に10進数の表記を返します。
@return 有理数の表記にした文字列を返します。
//emlist[例][ruby]{
Rational(5, 8).inspect # => "(5/8)"
Rational(2).inspect # => "(2/1)"
Rational(-8, 6).inspect # => "(-4/3)"
Rational(0.5).inspect # => "(1/2)"
//}
@see Rational#to_s... -
Rational
# numerator -> Integer (9031.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... -
Rational
# to _ s -> String (9031.0) -
自身を人間が読みやすい形の文字列表現にして返します。
..."-17/7" のように10進数の表記を返します。
@return 有理数の表記にした文字列を返します。
//emlist[例][ruby]{
Rational(3, 4).to_s # => "3/4"
Rational(8).to_s # => "8/1"
Rational(-8, 6).to_s # => "-4/3"
Rational(0.5).to_s # => "1/2"
//}
@see Rational#inspect... -
Rational
# marshal _ dump -> Array (9023.0) -
Marshal.#load のためのメソッドです。 Rational::compatible#marshal_load で復元可能な配列を返します。
...Marshal.#load のためのメソッドです。
Rational::compatible#marshal_load で復元可能な配列を返します。
[注意] Rational::compatible は通常の方法では参照する事ができません。... -
Rational
# negative? -> bool (9019.0) -
self が 0 未満の場合に true を返します。そうでない場合に false を返します。
...self が 0 未満の場合に true を返します。そうでない場合に false を返します。
//emlist[例][ruby]{
Rational(1, 2).negative? # => false
Rational(-1, 2).negative? # => true
//}
@see Rational#positive?... -
Rational
# positive? -> bool (9019.0) -
self が 0 より大きい場合に true を返します。そうでない場合に false を返します。
...self が 0 より大きい場合に true を返します。そうでない場合に false を返します。
//emlist[例][ruby]{
Rational(1, 2).positive? # => true
Rational(-1, 2).positive? # => false
//}
@see Rational#negative?... -
Rational
# to _ json(*args) -> String (9019.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...