1616件ヒット
[1-100件を表示]
(0.120秒)
ライブラリ
クラス
- BigDecimal (84)
- Bignum (12)
- Complex (144)
-
Enumerator
:: ArithmeticSequence (49) - Fixnum (9)
- Float (48)
- Integer (288)
- Matrix (84)
-
Matrix
:: LUPDecomposition (24) -
Net
:: FTP (24) -
Net
:: HTTP (7) - Numeric (611)
- Object (12)
- OptionParser (144)
- Range (12)
- Rational (28)
- Vector (12)
モジュール
- Kernel (24)
キーワード
- % (36)
- * (48)
- ** (16)
- + (12)
- +@ (12)
- - (12)
- -@ (12)
-
/ (84) - <=> (12)
- [] (30)
- abs (24)
- abs2 (24)
- angle (12)
- arg (12)
- begin (7)
- ceil (24)
-
check
_ signedness (24) - clone (12)
- coerce (24)
- conj (12)
- conjugate (12)
- denominator (12)
- det (24)
- determinant (24)
- div (24)
- divmod (42)
- downto (24)
- end (7)
- eql? (12)
- fdiv (30)
- finite? (9)
- first (14)
- floor (36)
- 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) - phase (12)
- 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
# i -> Complex (39150.0) -
Complex(0, self) を返します。
...Complex(0, self) を返します。
ただし、Complex オブジェクトでは利用できません。
//emlist[例][ruby]{
10.i # => (0+10i)
-10.i # => (0-10i)
(0.1).i # => (0+0.1i)
Rational(1, 2).i # => (0+(1/2)*i)
//}... -
Numeric
# infinite? -> nil (30207.0) -
常に nil を返します。 自身が Float かComplex、もしくはそのサブクラスのインスタンスの場合は、self の絶対値が負の無限大の場合に-1を、正の無限大の場合に1を、有限値の場合に nil を返します。
...il を返します。
自身が Float かComplex、もしくはそのサブクラスのインスタンスの場合は、self の絶対値が負の無限大の場合に-1を、正の無限大の場合に1を、有限値の場合に nil を返します。
//emlist[例][ruby]{
10.infinite? # => ni......l
(3r).infinite? # => nil
//}
@see Numeric#finite?、Float#infinite?、Complex#infinite?... -
Numeric
# divmod(other) -> [Numeric] (27226.0) -
self を other で割った商 q と余り r を、 [q, r] という 2 要素の配列にして返します。 商 q は常に整数ですが、余り r は整数であるとは限りません。
...数です。
divmod が返す商は Numeric#div と同じです。
また余りは、Numeric#modulo と同じです。
このメソッドは、メソッド / と % によって定義されています。
@param other 自身を割る数を指定します。
//emlist[例][ruby]{
11.divmod(3)......#=> [3, 2]
(11.5).divmod(3.5) #=> [3, 1.0]
11.divmod(-3) #=> [-4, -1]
11.divmod(3.5) #=> [3, 0.5]
(-11).divmod(3.5) #=> [-4, 3.0]
//}
@see Numeric#div, Numeric#modulo... -
Numeric
# to _ int -> Integer (27223.0) -
self.to_i と同じです。
...self.to_i と同じです。
//emlist[例][ruby]{
(2+0i).to_int # => 2
Rational(3).to_int # => 3
//}... -
Numeric
# remainder(other) -> Numeric (27214.0) -
self を other で割った余り r を返します。
...other 自身を割る数を指定します。
//emlist[例][ruby]{
p 13.remainder(4) #=> 1
p (11.5).remainder(3.5) #=> 1.0
p 13.remainder(-4) #=> 1
p (-13).remainder(4) #=> -1
p (-13).remainder(-4) #=> -1
p (-11).remainder(3.5) #=> -0.5
//}
@see Numeric#divmod, Numeric#modulo... -
Numeric
# denominator -> Integer (27207.0) -
自身を Rational に変換した時の分母を返します。
...自身を Rational に変換した時の分母を返します。
@return 分母を返します。
@see Numeric#numerator、Integer#denominator、Float#denominator、Rational#denominator、Complex#denominator... -
Numeric
# magnitude -> Numeric (27203.0) -
自身の絶対値を返します。
...自身の絶対値を返します。
//emlist[例][ruby]{
12.abs #=> 12
(-34.56).abs #=> 34.56
-34.56.abs #=> 34.56
//}... -
Numeric
# fdiv(other) -> Float | Complex (27125.0) -
self を other で割った商を 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
# ceil -> Integer (27119.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...