1554件ヒット
[201-300件を表示]
(0.017秒)
ライブラリ
クラス
- BigDecimal (77)
- Bignum (12)
- Complex (165)
-
Enumerator
:: ArithmeticSequence (42) - Fixnum (9)
- Float (44)
- Integer (263)
- Matrix (77)
-
Matrix
:: LUPDecomposition (22) -
Net
:: FTP (22) -
Net
:: HTTP (6) - Numeric (547)
- Object (22)
-
OpenSSL
:: BN (11) - OptionParser (132)
- Range (11)
- Rational (26)
- UnboundMethod (11)
- Vector (33)
モジュール
- Kernel (22)
キーワード
- % (33)
- * (55)
- ** (15)
- + (11)
- +@ (11)
- - (11)
- -@ (11)
-
/ (77) - <=> (11)
- [] (27)
- abs (22)
- abs2 (22)
- angle (22)
- arg (22)
- begin (6)
- ceil (22)
-
check
_ signedness (22) - clone (11)
- coerce (33)
- conj (11)
- conjugate (11)
- denominator (11)
- det (22)
- determinant (22)
- div (22)
- divmod (39)
- downto (22)
- dup (11)
- end (6)
- eql? (11)
- fdiv (28)
- finite? (8)
- first (12)
- floor (33)
- i (11)
- imag (22)
- imaginary (22)
- infinite? (8)
- integer? (11)
- last (12)
- magnitude (22)
- modulo (33)
- negative? (9)
- nonzero? (11)
- numerator (11)
- on (132)
-
open
_ timeout (11) - owner (11)
- phase (22)
- polar (22)
- positive? (9)
- pow (22)
- quo (44)
-
read
_ timeout (11) - real (22)
- real? (33)
- rect (22)
- rectangular (22)
- remainder (36)
- round (22)
- size (11)
- step (90)
- times (22)
-
to
_ c (11) -
to
_ i (11) -
to
_ int (11) - truncate (33)
- upto (22)
-
write
_ timeout (6) - zero? (11)
検索結果
先頭5件
-
Numeric
# round -> Integer (21019.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 (21019.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 (21013.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 (21013.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 (21013.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 (21013.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 (21013.0) -
自身が Integer かそのサブクラスのインスタンスの場合にtrue を返し ます。そうでない場合に false を返します。
...スタンスの場合にtrue を返し
ます。そうでない場合に false を返します。
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
//emlist[例][ruby]{
(1.0).integer? #=> false
(1).integer? #=> true
//}
@see Numeric#real?... -
Numeric
# real? -> bool (21013.0) -
常に true を返します。(Complex またはそのサブクラスではないことを意味します。)
...ます。)
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
//emlist[例][ruby]{
10.real? # => true
-10.real? # => true
0.1.real? # => true
Rational(2, 3).real? # => true
//}
@see Numeric#integer?、... -
Numeric
# <=>(other) -> -1 | 0 | 1 | nil (21007.0) -
自身が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には -1 をそれぞれ返します。 自身と other が比較できない場合には nil を返します。
...場合に 0 を、小さい場合には -1 をそれぞれ返します。
自身と other が比較できない場合には nil を返します。
Numeric のサブクラスは、上の動作を満たすよう このメソッドを適切に再定義しなければなりません。
@param other... -
Numeric
# angle -> 0 | Math :: PI (21007.0) -
自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。
...自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。
//emlist[例][ruby]{
1.arg # => 0
-1.arg # => 3.141592653589793
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Complex#arg...