2106件ヒット
[1-100件を表示]
(0.105秒)
ライブラリ
- ビルトイン (1269)
- bigdecimal (60)
-
bigdecimal
/ jacobian (24) - csv (24)
- mathn (13)
- matrix (168)
- mkmf (24)
-
net
/ ftp (24) -
net
/ http (7) - openssl (84)
- optparse (144)
- psych (14)
- securerandom (8)
- socket (96)
クラス
- BigDecimal (60)
- Bignum (9)
- CSV (24)
- Complex (156)
-
Enumerator
:: ArithmeticSequence (49) - Fixnum (6)
- Float (48)
- Integer (288)
- Matrix (84)
-
Matrix
:: LUPDecomposition (24) -
Net
:: FTP (24) -
Net
:: HTTP (7) - Numeric (611)
- Object (12)
-
OpenSSL
:: ASN1 :: NumericString (24) -
OpenSSL
:: BN (12) - OptionParser (144)
- Range (12)
- Rational (28)
- Socket (48)
- UnboundMethod (12)
- Vector (36)
モジュール
- GC (24)
- Jacobian (24)
- Kernel (24)
- Math (8)
-
OpenSSL
:: ASN1 (36) - Psych (14)
- SecureRandom (8)
-
Socket
:: Constants (48)
キーワード
- % (24)
- * (60)
- ** (16)
- + (12)
- +@ (12)
- - (12)
- -@ (12)
-
/ (96) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - <=> (12)
-
AI
_ NUMERICHOST (24) -
AI
_ NUMERICSERV (24) - ArithmeticSequence (7)
- Converters (12)
- Matrix (12)
-
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 3
. 0 . 0 (5) -
NI
_ NUMERICHOST (24) -
NI
_ NUMERICSERV (24) - NUMERICSTRING (12)
- NumericString (36)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
- Ruby用語集 (12)
- Vector (12)
- [] (24)
- abs (24)
- abs2 (24)
- alphanumeric (8)
- angle (12)
- arg (24)
- begin (7)
- bigdecimal (12)
- ceil (24)
-
check
_ signedness (24) - clone (12)
- coerce (36)
- conj (12)
- conjugate (12)
- denominator (12)
- det (24)
- determinant (24)
- dfdxi (12)
- div (24)
- divmod (42)
- downto (24)
- end (7)
- eql? (12)
- fdiv (30)
- finite? (9)
- first (14)
- floor (36)
- i (12)
- imag (24)
- imaginary (24)
- infinite? (9)
- integer? (12)
- jacobian (12)
- last (14)
- magnitude (24)
- matrix (12)
- modulo (24)
- negative? (10)
- new (24)
- nonzero? (12)
- numerator (12)
- on (144)
-
open
_ timeout (12) - owner (12)
- phase (12)
- polar (24)
- positive? (10)
- pow (24)
- quo (48)
-
rb
_ num2dbl (12) -
read
_ timeout (12) - real (24)
- real? (36)
- rect (24)
- rectangular (24)
- remainder (39)
- round (24)
- rsqrt (4)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 4 feature (12) -
safe
_ load (14) - size (12)
- sqrt (4)
- stat (24)
- step (100)
- table (12)
- times (24)
-
to
_ c (12) -
to
_ i (12) -
to
_ int (12) - truncate (36)
- upto (24)
-
write
_ timeout (7) - zero? (12)
検索結果
先頭5件
-
Numeric (44256.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...を表す抽象クラスです。Integer や Float などの数値クラス
は Numeric のサブクラスとして実装されています。
演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは......して定義されるものがほとんどです。
つまり Numeric で定義されているメソッドは、Numeric のサブクラスとして新たに数値クラスを定義した時に、
演算メソッド(+, -, *, /, %, <=>, coerce)だけを定義すれば、数値クラスのそのほか......表しメソッド定義などではこの記法を利用します。
効率のため Numeric のメソッドと同じメソッドがサブクラスで再定義されている場合があります。
Numeric#coerce メソッドを使うことによって異なる数値クラス間で演算を行... -
Numeric
# rect -> [Numeric , Numeric] (27310.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] (27310.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
# polar -> [Numeric , Numeric] (27308.0) -
自身の絶対値と偏角を配列にして返します。正の数なら [self, 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 のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Complex#polar... -
Numeric
# remainder(other) -> Numeric (27259.0) -
self を other で割った余り r を返します。
...self を other で割った余り r を返します。
ここで、商 q と余り r は、
* self == other * q + r
と
* self > 0 のとき 0 <= r < |other|
* self < 0 のとき -|other| < r <= 0
* q は整数
をみたす数です。r の符号は self と同じになります。......other).truncate がそれに相当します。
@param 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
# floor -> Integer (27218.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
# real -> Numeric (27213.0) -
自身を返します。
...す。
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
//emlist[例][ruby]{
10.real # => 10
-10.real # => -10
0.1.real # => 0.1
Rational(2, 3).real # => (2/3)
//}
@see Numeric#imag、Complex#real... -
Numeric
# coerce(other) -> [Numeric] (27207.0) -
自身と other が同じクラスになるよう、自身か other を変換し [other, self] という配列にして返します。
...自身と other が同じクラスになるよう、自身か other を変換し [other, self] という配列にして返します。
デフォルトでは self と other を Float に変換して [other, self] という配列にして返します。
Numeric のサブクラスは、このメソ......以下は Rational の coerce のソースです。other が自身の知らない数値クラスであった場合、
super を呼んでいることに注意して下さい。
//emlist[例][ruby]{
# lib/rational.rb より
def coerce(other)
if other.kind_of?(Float)
return other, self.to_f......elsif other.kind_of?(Integer)
return Rational.new!(other, 1), self
else
super
end
end
//}
数値クラスの算術演算子は通常自分と演算できないクラスをオペランドとして受け
取ると coerce を使って自分とオペランドを変換した上で演算を... -
Numeric
# denominator -> Integer (27206.0) -
自身を Rational に変換した時の分母を返します。
...自身を Rational に変換した時の分母を返します。
@return 分母を返します。
@see Numeric#numerator、Integer#denominator、Float#denominator、Rational#denominator、Complex#denominator... -
Numeric
# floor(ndigits = 0) -> Integer (27118.0) -
自身と等しいかより小さな整数のうち最大のものを返します。
...@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
負の整数を指定した場合、小数点位置から左に少なくとも 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...