563件ヒット
[501-563件を表示]
(0.085秒)
別のキーワード
ライブラリ
- ビルトイン (563)
キーワード
- % (12)
- +@ (12)
- <=> (12)
- abs (12)
- abs2 (12)
- angle (12)
- arg (12)
- ceil (12)
- coerce (12)
- conj (12)
- conjugate (12)
- div (12)
- divmod (12)
- eql? (12)
- fdiv (12)
- finite? (9)
- floor (12)
- i (12)
- imag (12)
- imaginary (12)
- infinite? (9)
- integer? (12)
- magnitude (12)
- modulo (12)
- negative? (10)
- nonzero? (12)
- phase (12)
- polar (12)
- positive? (10)
- quo (12)
- real (12)
- real? (12)
- rect (12)
- rectangular (12)
- remainder (12)
- round (12)
- step (93)
-
to
_ c (12) -
to
_ int (12) - truncate (12)
- zero? (12)
検索結果
先頭5件
-
Numeric
# remainder(other) -> Numeric (8.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
# round -> Integer (8.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
# to _ c -> Complex (8.0) -
自身を複素数 (Complex) に変換します。Complex(self, 0) を返します。
...に変換します。Complex(self, 0) を返します。
//emlist[例][ruby]{
1.to_c # => (1+0i)
-1.to_c # => (-1+0i)
1.0.to_c # => (1.0+0i)
Rational(1, 2).to_c # => ((1/2)+0i)
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなけ... -
Numeric
# to _ int -> Integer (8.0) -
self.to_i と同じです。
...self.to_i と同じです。
//emlist[例][ruby]{
(2+0i).to_int # => 2
Rational(3).to_int # => 3
//}... -
Numeric
# truncate -> Integer (8.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
# zero? -> bool (8.0) -
自身がゼロの時、trueを返します。そうでない場合は false を返します。
...自身がゼロの時、trueを返します。そうでない場合は false を返します。
//emlist[例][ruby]{
p 10.zero? #=> false
p 0.zero? #=> true
p 0.0.zero? #=> true
//}
@see Numeric#nonzero?...