981件ヒット
[1-100件を表示]
(0.034秒)
別のキーワード
ライブラリ
- ビルトイン (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
# rationalize(eps = 0) -> Rational (27236.0) -
自身から eps で指定した許容誤差の範囲に収まるような Rational を返 します。
...な Rational を返
します。
eps を省略した場合は self を返します。
@param eps 許容する誤差
//emlist[例][ruby]{
r = Rational(5033165, 16777216)
r.rationalize # => (5033165/16777216)
r.rationalize(Rational(0.01)) # => (3/10)
r.rationalize(Rational(0.1))... -
Float
# rationalize -> Rational (18225.0) -
自身から eps で指定した許容誤差の範囲に収まるような Rational を返 します。
...るような Rational を返
します。
eps を省略した場合は誤差が最も小さくなるような Rational を返しま
す。
@param eps 許容する誤差
//emlist[例][ruby]{
0.3.rationalize # => (3/10)
1.333.rationalize # => (1333/1000)
1.333.rationalize(0.01) # =... -
Float
# rationalize(eps) -> Rational (18225.0) -
自身から eps で指定した許容誤差の範囲に収まるような Rational を返 します。
...るような Rational を返
します。
eps を省略した場合は誤差が最も小さくなるような Rational を返しま
す。
@param eps 許容する誤差
//emlist[例][ruby]{
0.3.rationalize # => (3/10)
1.333.rationalize # => (1333/1000)
1.333.rationalize(0.01) # =... -
Complex
# rationalize -> Rational (18220.0) -
自身を Rational に変換します。
...自身を Rational に変換します。
@param eps 許容する誤差。常に無視されます。
@raise RangeError 虚部が実数か、0 ではない場合に発生します。
//emlist[例][ruby]{
Complex(3).to_r # => (3/1)
Complex(3, 2).to_r # => RangeError
//}... -
Complex
# rationalize(eps) -> Rational (18220.0) -
自身を Rational に変換します。
...自身を Rational に変換します。
@param eps 許容する誤差。常に無視されます。
@raise RangeError 虚部が実数か、0 ではない場合に発生します。
//emlist[例][ruby]{
Complex(3).to_r # => (3/1)
Complex(3, 2).to_r # => RangeError
//}... -
Integer
# rationalize -> Rational (18219.0) -
自身を Rational に変換します。
...自身を Rational に変換します。
@param eps 許容する誤差
引数 eps は常に無視されます。
//emlist[][ruby]{
2.rationalize # => (2/1)
2.rationalize(100) # => (2/1)
2.rationalize(0.1) # => (2/1)
//}... -
Integer
# rationalize(eps) -> Rational (18219.0) -
自身を Rational に変換します。
...自身を Rational に変換します。
@param eps 許容する誤差
引数 eps は常に無視されます。
//emlist[][ruby]{
2.rationalize # => (2/1)
2.rationalize(100) # => (2/1)
2.rationalize(0.1) # => (2/1)
//}... -
NilClass
# rationalize -> Rational (18203.0) -
0/1 を返します。
...0/1 を返します。
@param eps 許容する誤差
引数 eps は常に無視されます。
//emlist[例][ruby]{
nil.rationalize # => (0/1)
nil.rationalize(100) # => (0/1)
nil.rationalize(0.1) # => (0/1)
//}... -
NilClass
# rationalize(eps) -> Rational (18203.0) -
0/1 を返します。
...0/1 を返します。
@param eps 許容する誤差
引数 eps は常に無視されます。
//emlist[例][ruby]{
nil.rationalize # => (0/1)
nil.rationalize(100) # => (0/1)
nil.rationalize(0.1) # => (0/1)
//}... -
Rational
# floor(precision = 0) -> Integer | Rational (9198.0) -
自身と等しいかより小さな整数のうち最大のものを返します。
...[ruby]{
Rational(3).floor # => 3
Rational(2, 3).floor # => 0
Rational(-3, 2).floor # => -2
//}
Rational#to_i とは違う結果を返す事に注意してください。
//emlist[例][ruby]{
Rational(+7, 4).to_i # => 1
Rational(+7, 4).floor # => 1
Rational(-7, 4).to_i # => -1
Rational(-7, 4......か Rational を返します。
//emlist[例][ruby]{
Rational('-123.456').floor(+1) # => (-247/2)
Rational('-123.456').floor(+1).to_f # => -123.5
Rational('-123.456').floor(0) # => -124
Rational('-123.456').floor(-1) # => -130
//}
@see Rational#ceil, Rational#round, Rational#tr...