るりまサーチ

最速Rubyリファレンスマニュアル検索!
614件ヒット [1-100件を表示] (0.219秒)
トップページ > クラス:Float[x] > クエリ:_builtin[x] > クエリ:>[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Float#>(other) -> bool (26107.0)

比較演算子。数値として大きいか判定します。

...として大きいか判定します。

@param other 比較対象の数値
@return self よりも other の方が小さい場合 true を返します。
そうでなければ false を返します。

//emlist[例][ruby]{
3.14 > 3.1415 # => false
3.14 >= 3.1415 # => false
//}...

Float#>=(other) -> bool (14107.0)

比較演算子。数値として等しいまたは大きいか判定します。

...ram other 比較対象の数値
@return self よりも other の方が小さい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。

//emlist[例][ruby]{
3.14 > 3.1415 # => false
3.14 >= 3.1415 # => false
//}...

Float#<=>(other) -> -1 | 0 | 1 | nil (14101.0)

self と other を比較して、self が大きい時に正、 等しい時に 0、小さい時に負の整数を返します。 比較できない場合はnilを返します

...self が大きい時に正、
等しい時に 0、小さい時に負の整数を返します。
比較できない場合はnilを返します

//emlist[例][ruby]{
3.05 <=> 3.14 # => -1
1.732 <=> 1.414 # => 1
3.3 - 3.3 <=> 0.0 # => 0
3.14 <=> "hoge" # => nil
3.14 <=> 0.0/0.0 # => nil
//}...

Float#divmod(other) -> [Numeric] (8107.0)

self を other で割った商 q と余り r を、 [q, r] という 2 要素の配列にして返します。 商 q は常に整数ですが、余り r は整数であるとは限りません。

...整数ですが、余り r は整数であるとは限りません。

ここで、商 q と余り r は、

* self == other * q + r

* other > 0 のとき: 0 <= r < other
* other < 0 のとき: other < r <= 0
* q は整数
をみたす数です。
このメソッドは、メソッ...
...ます。

@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...

Float#%(other) -> Float (8101.0)

算術演算子。剰余を計算します。

...算術演算子。剰余を計算します。

@param other 二項演算の右側の引数(対象)

//emlist[例][ruby]{
# 剰余
3.0 % 1.2 # => 0.6000000000000001
3.0 % 0.0 # ZeroDivisionError
//}...

絞り込み条件を変える

Float#*(other) -> Float (8101.0)

算術演算子。積を計算します。

...算術演算子。積を計算します。

@param other 二項演算の右側の引数(対象)

//emlist[例][ruby]{
# 積
2.4 * 3 # => 7.2
//}...

Float#**(other) -> Float (8101.0)

算術演算子。冪を計算します。

...算術演算子。冪を計算します。

@param other 二項演算の右側の引数(対象)

//emlist[例][ruby]{
# 冪
1.2 ** 3.0 # => 1.7279999999999998
3.0 + 4.5 - 1.3 / 2.4 * 3 % 1.2 ** 3.0 # => 5.875
0.0 ** 0 # => 1.0
//}...

Float#+(other) -> Float (8101.0)

算術演算子。和を計算します。

...算術演算子。和を計算します。

@param other 二項演算の右側の引数(対象)

//emlist[例][ruby]{
# 和
3.0 + 4.5 # => 7.5
//}...

Float#-(other) -> Float (8101.0)

算術演算子。差を計算します。

...算術演算子。差を計算します。

@param other 二項演算の右側の引数(対象)

//emlist[例][ruby]{
# 差
4.5 - 1.3 # => 3.2
//}...

Float#-@ -> Float (8101.0)

単項演算子の - です。 self の符号を反転させたものを返します。

...単項演算子の - です。
self の符号を反転させたものを返します。

//emlist[例][ruby]{
- 1.2 # => -1.2
- -1.2 # => 1.2
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>