563件ヒット
[401-500件を表示]
(0.053秒)
別のキーワード
ライブラリ
- ビルトイン (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
# phase -> 0 | Math :: PI (14.0) -
自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。
...自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。
//emlist[例][ruby]{
1.arg # => 0
-1.arg # => 3.141592653589793
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Complex#arg... -
Numeric
# polar -> [Numeric , Numeric] (14.0) -
自身の絶対値と偏角を配列にして返します。正の数なら [self, 0]、負の数な ら [-self, Math::PI] を返します。
...0]、負の数な
ら [-self, Math::PI] を返します。
//emlist[例][ruby]{
1.0.polar # => [1.0, 0]
2.0.polar # => [2.0, 0]
-1.0.polar # => [1.0, 3.141592653589793]
-2.0.polar # => [2.0, 3.141592653589793]
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなけ... -
Numeric
# positive? -> bool (14.0) -
self が 0 より大きい場合に true を返します。そうでない場合に false を返します。
...self が 0 より大きい場合に true を返します。そうでない場合に false を返します。
//emlist[例][ruby]{
1.positive? # => true
0.positive? # => false
-1.positive? # => false
//}
@see Numeric#negative?... -
Numeric
# quo(other) -> Rational | Float | Complex (14.0) -
self を other で割った商を返します。 整商を得たい場合は Numeric#div を使ってください。
...self を other で割った商を返します。
整商を得たい場合は Numeric#div を使ってください。
Numeric#fdiv が結果を Float で返すメソッドなのに対して quo はなるべく正確な数値を返すことを意図しています。
具体的には有理数の範......が関わるときはそれらのクラスになります。
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@param other 自身を割る数を指定します。
//emlist[例][ruby]{
1.quo(3) #=> (1/3)
1.0.quo(3) #=> 0.333333333333......3333
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
# real -> Numeric (14.0) -
自身を返します。
...返します。
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
//emlist[例][ruby]{
10.real # => 10
-10.real # => -10
0.1.real # => 0.1
Rational(2, 3).real # => (2/3)
//}
@see Numeric#imag、Comple... -
Numeric
# real? -> bool (14.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
# rect -> [Numeric , Numeric] (14.0) -
[self, 0] を返します。
...[self, 0] を返します。
//emlist[例][ruby]{
1.rect # => [1, 0]
-1.rect # => [-1, 0]
1.0.rect # => [1.0, 0]
-1.0.rect # => [-1.0, 0]
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Complex#rect... -
Numeric
# rectangular -> [Numeric , Numeric] (14.0) -
[self, 0] を返します。
...[self, 0] を返します。
//emlist[例][ruby]{
1.rect # => [1, 0]
-1.rect # => [-1, 0]
1.0.rect # => [1.0, 0]
-1.0.rect # => [-1.0, 0]
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Complex#rect... -
Numeric
# remainder(other) -> Numeric (14.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...