1712件ヒット
[201-300件を表示]
(0.022秒)
ライブラリ
クラス
- BigDecimal (84)
- Bignum (12)
- Complex (180)
-
Enumerator
:: ArithmeticSequence (49) - Fixnum (9)
- Float (48)
- Integer (288)
- Matrix (84)
-
Matrix
:: LUPDecomposition (24) -
Net
:: FTP (24) -
Net
:: HTTP (7) - Numeric (611)
- Object (24)
-
OpenSSL
:: BN (12) - OptionParser (144)
- Range (12)
- Rational (28)
- UnboundMethod (12)
- Vector (36)
モジュール
- Kernel (24)
キーワード
- % (36)
- * (60)
- ** (16)
- + (12)
- +@ (12)
- - (12)
- -@ (12)
-
/ (96) - <=> (12)
- [] (30)
- abs (24)
- abs2 (24)
- angle (24)
- arg (24)
- begin (7)
- ceil (24)
-
check
_ signedness (24) - clone (12)
- coerce (36)
- conj (12)
- conjugate (12)
- denominator (12)
- det (24)
- determinant (24)
- div (24)
- divmod (42)
- downto (24)
- dup (12)
- end (7)
- eql? (12)
- fdiv (30)
- finite? (9)
- first (14)
- floor (36)
- i (12)
- imag (24)
- imaginary (24)
- infinite? (9)
- integer? (12)
- last (14)
- magnitude (24)
- modulo (36)
- negative? (10)
- nonzero? (12)
- numerator (12)
- on (144)
-
open
_ timeout (12) - owner (12)
- phase (24)
- polar (24)
- positive? (10)
- pow (24)
- quo (48)
-
read
_ timeout (12) - real (24)
- real? (36)
- rect (24)
- rectangular (24)
- remainder (39)
- round (24)
- size (12)
- step (100)
- times (24)
-
to
_ c (12) -
to
_ i (12) -
to
_ int (12) - truncate (36)
- upto (24)
-
write
_ timeout (7) - zero? (12)
検索結果
先頭5件
-
Numeric
# quo(other) -> Rational | Float | Complex (9035.0) -
self を other で割った商を返します。 整商を得たい場合は Numeric#div を使ってください。
...self を other で割った商を返します。
整商を得たい場合は Numeric#div を使ってください。
Numeric#fdiv が結果を Float で返すメソッドなのに対して quo はなるべく正確な数値を返すことを意図しています。
具体的には有理数の範......囲に収まる計算では Rational の値を返します。
Float や Complex が関わるときはそれらのクラスになります。
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@param other 自身を割る数を指定します......。
//emlist[例][ruby]{
1.quo(3) #=> (1/3)
1.0.quo(3) #=> 0.3333333333333333
1.quo(3.0) #=> 0.3333333333333333
1.quo(0.5) #=> 2.0
Complex(1, 1).quo(1) #=> ((1/1)+(1/1)*i)
1.quo(Complex(1, 1)) #=> ((1/2)-(1/2)*i)
//}
@see Numeric#fdiv... -
Numeric
# ceil -> Integer (9019.0) -
自身と等しいかより大きな整数のうち最小のものを返します。
...自身と等しいかより大きな整数のうち最小のものを返します。
//emlist[例][ruby]{
1.ceil #=> 1
1.2.ceil #=> 2
(-1.2).ceil #=> -1
(-1.5).ceil #=> -1
//}
@see Numeric#floor, Numeric#round, Numeric#truncate... -
Numeric
# floor -> Integer (9019.0) -
自身と等しいかより小さな整数のうち最大のものを返します。
...自身と等しいかより小さな整数のうち最大のものを返します。
//emlist[例][ruby]{
1.floor #=> 1
1.2.floor #=> 1
(-1.2).floor #=> -2
(-1.5).floor #=> -2
//}
@see Numeric#ceil, Numeric#round, Numeric#truncate... -
Numeric
# floor(ndigits = 0) -> Integer (9019.0) -
自身と等しいかより小さな整数のうち最大のものを返します。
...負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。
//emlist[例][ruby]{
1.floor #=> 1
1.2.floor #=> 1
(-1.2).floor #=> -2
(-1.5).floor #=> -2
//}
@see Numeric#ceil, Numeric#round, Numeric#truncate
@see Integer#floor... -
Numeric
# floor(ndigits = 0) -> Integer | Float (9019.0) -
自身と等しいかより小さな整数のうち最大のものを返します。
...Integer を返します。
小数点位置から左に少なくとも n 個の 0 が並びます。
//emlist[例][ruby]{
1.floor #=> 1
1.2.floor #=> 1
(-1.2).floor #=> -2
(-1.5).floor #=> -2
//}
@see Numeric#ceil, Numeric#round, Numeric#truncate
@see Integer#floor... -
Numeric
# round -> Integer (9019.0) -
自身ともっとも近い整数を返します。
...0.5, -0.5 はそれぞれ 1,-1 に切り上げされます。いわゆる四捨五入ですが、偶数丸めではありません。
//emlist[例][ruby]{
1.round #=> 1
1.2.round #=> 1
(-1.2).round #=> -1
(-1.5).round #=> -2
//}
@see Numeric#ceil, Numeric#floor, Numeric#truncate... -
Numeric
# truncate -> Integer (9019.0) -
0 から 自身までの整数で、自身にもっとも近い整数を返します。
...0 から 自身までの整数で、自身にもっとも近い整数を返します。
//emlist[例][ruby]{
1.truncate #=> 1
1.2.truncate #=> 1
(-1.2).truncate #=> -1
(-1.5).truncate #=> -1
//}
@see Numeric#ceil, Numeric#floor, Numeric#round... -
Numeric
# fdiv(other) -> Float | Complex (9013.0) -
self を other で割った商を Float で返します。 ただし Complex が関わる場合は例外です。 その場合も成分は Float になります。
...割った商を Float で返します。
ただし Complex が関わる場合は例外です。
その場合も成分は Float になります。
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@param other 自身を割る数を指定しま......す。
//emlist[例][ruby]{
1.fdiv(3) #=> 0.3333333333333333
Complex(1, 1).fdiv 1 #=> (1.0+1.0i)
1.fdiv Complex(1, 1) #=> (0.5-0.5i)
//}
@see Numeric#quo... -
Numeric
# finite? -> bool (9013.0) -
self の絶対値が有限値の場合に true を、そうでない場合に false を返します。
...値の場合に true を、そうでない場合に false を返します。
//emlist[例][ruby]{
10.finite? # => true
Rational(3).finite? # => true
Float::INFINITY.finite? # => false
Float::INFINITY.is_a?(Numeric) # => true
//}
@see Numeric#infinite?... -
Numeric
# imag -> 0 (9013.0) -
常に 0 を返します。
...常に 0 を返します。
//emlist[例][ruby]{
12.imag # => 0
-12.imag # => 0
1.2.imag # => 0
-1.2.imag # => 0
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Numeric#real、Complex#imag... -
Numeric
# imaginary -> 0 (9013.0) -
常に 0 を返します。
...常に 0 を返します。
//emlist[例][ruby]{
12.imag # => 0
-12.imag # => 0
1.2.imag # => 0
-1.2.imag # => 0
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Numeric#real、Complex#imag... -
Numeric
# integer? -> bool (9013.0) -
自身が Integer かそのサブクラスのインスタンスの場合にtrue を返し ます。そうでない場合に false を返します。
...スタンスの場合にtrue を返し
ます。そうでない場合に false を返します。
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
//emlist[例][ruby]{
(1.0).integer? #=> false
(1).integer? #=> true
//}
@see Numeric#real?...