279件ヒット
[1-100件を表示]
(0.109秒)
ライブラリ
- ビルトイン (218)
- bigdecimal (48)
-
minitest
/ unit (1) -
rubygems
/ requirement (12)
クラス
- Array (65)
- BigDecimal (48)
- Complex (12)
- Fixnum (3)
- Float (24)
-
Gem
:: Requirement (12) - Hash (10)
- Integer (12)
- Module (12)
- Range (24)
モジュール
- Comparable (24)
- Enumerable (32)
-
MiniTest
:: Assertions (1)
キーワード
-
assert
_ in _ epsilon (1) - between? (12)
- bsearch (48)
-
bsearch
_ index (20) - ceil (12)
- floor (24)
- none? (53)
-
to
_ s (12)
検索結果
先頭5件
-
Comparable
# >=(other) -> bool (27319.0) -
比較演算子 <=> をもとにオブジェクト同士を比較します。 <=> が正の整数か 0 を返した場合に、true を返します。 それ以外の整数を返した場合に、false を返します。
...=> をもとにオブジェクト同士を比較します。
<=> が正の整数か 0 を返した場合に、true を返します。
それ以外の整数を返した場合に、false を返します。
@param other 自身と比較したいオブジェクトを指定します。
@raise ArgumentErr......or <=> が nil を返したときに発生します。
//emlist[例][ruby]{
1 >= 0 # => true
1 >= 1 # => true
1 >= 2 # => false
//}... -
Integer
# >=(other) -> bool (27319.0) -
比較演算子。数値として等しいまたは大きいか判定します。
...@param other 比較対象の数値
@return self よりも other の方が小さい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[][ruby]{
1 >= 0 # => true
1 >= 1 # => true
1 >= 2 # => fal... -
Module
# >=(other) -> bool | nil (24337.0) -
比較演算子。self が other の先祖か同一クラスである場合、 true を返します。 self が other の子孫である場合、false を返します。
...ther の先祖か同一クラスである場合、 true を返します。
self が other の子孫である場合、false を返します。
継承関係にないクラス同士の比較では
nil を返します。
@param other 比較対象のモジュールやクラス
@raise TypeError other......ule#<
//emlist[例][ruby]{
module Foo; end
module Bar
include Foo
end
module Baz
prepend Foo
end
Bar.ancestors # => [Bar, Foo]
Foo >= Bar # => true
Bar >= Foo # => false
Baz.ancestors # => [Foo, Baz]
Foo >= Baz # => true
Baz >= Foo # => false
Foo >= Foo # => true
Foo >= Object # => nil
//}... -
Hash
# >=(other) -> bool (24319.0) -
other が self のサブセットか同じである場合に真を返します。
...other が self のサブセットか同じである場合に真を返します。
@param other 自身と比較したい Hash オブジェクトを指定します。
//emlist[例][ruby]{
h1 = {a:1, b:2}
h2 = {a:1, b:2, c:3}
h1 >= h2 # => false
h2 >= h1 # => true
h1 >= h1 # => true
//}
@see......Hash#<=, Hash#<, Hash#>... -
Float
# >=(other) -> bool (24313.0) -
比較演算子。数値として等しいまたは大きいか判定します。
...@param other 比較対象の数値
@return self よりも other の方が小さい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[例][ruby]{
3.14 > 3.1415 # => false
3.14 >= 3.1415 # => false... -
BigDecimal
# >=(other) -> bool (24301.0) -
self が other より大きいか等しい場合に true を、そうでない場合に false を返します。
...self が other より大きいか等しい場合に true を、そうでない場合に false
を返します。... -
Complex
# >=(other) -> bool (24301.0) -
@undef
@undef -
Fixnum
# >=(other) -> bool (24301.0) -
比較演算子。数値として等しいまたは大きいか判定します。
...演算子。数値として等しいまたは大きいか判定します。
@param other 比較対象の数値
@return self よりも other の方が小さい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。... -
Float
# >(other) -> bool (18213.0) -
比較演算子。数値として大きいか判定します。
...として大きいか判定します。
@param other 比較対象の数値
@return self よりも other の方が小さい場合 true を返します。
そうでなければ false を返します。
//emlist[例][ruby]{
3.14 > 3.1415 # => false
3.14 >= 3.1415 # => false
//}... -
MiniTest
:: Assertions # assert _ in _ epsilon(actual , expected , epsilon = 0 . 001 , message = nil) -> true (9207.0) -
与えられた期待値と実際の値の相対誤差が許容範囲内である場合、検査にパスしたことになります。
...パスします。
[expected, actual].min * epsilon >= (extected - actual).abs
@param expected 期待値を指定します。
@param actual 実際の値を指定します。
@param epsilon 許容する相対誤差を指定します。
@param message 検査に失敗した場合に表示する......メッセージを指定します。
文字列か Proc を指定します。Proc である場合は Proc#call した
結果を使用します。
@raise MiniTest::Assertion 検査に失敗した場合に発生します。... -
BigDecimal
# floor -> Integer (6307.0) -
self 以下の最大整数を返します。
...数を返します。
@param n 小数点以下の桁数を整数で指定します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").floor # => 1
BigDecimal("-1.23456").floor # => -2
//}
以下のように引数 n を与えることもできます。
n >= 0 なら、小数点以......にします)。
n が負のときは小数点以上 n 桁目を操作します
(小数点位置から左に少なくとも n 個の 0 が並びます)。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").floor(4).to_f # => 1.2345
BigDecimal("15.23456").floor(-1).to_f # => 10.0
//}...