るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.037秒)

別のキーワード

  1. _builtin negative?
  2. bigdecimal sign_negative_zero
  3. bigdecimal sign_negative_finite
  4. bigdecimal sign_negative_infinite
  5. float negative?

クラス

検索結果

Float#negative? -> bool (54367.0)

self が 0 未満の場合に true を返します。そうでない場合に false を返します。

self が 0 未満の場合に true を返します。そうでない場合に false を返します。

//emlist[例][ruby]{
-0.1.negative? # => true
0.0.negative? # => false
0.1.negative? # => false
//}

@see Float#positive?

Numeric#negative? -> bool (54367.0)

self が 0 未満の場合に true を返します。そうでない場合に false を返します。

self が 0 未満の場合に true を返します。そうでない場合に false を返します。

//emlist[例][ruby]{
-1.negative? # => true
0.negative? # => false
1.negative? # => false
//}

@see Numeric#positive?

Rational#negative? -> bool (54349.0)

self が 0 未満の場合に true を返します。そうでない場合に false を返します。

self が 0 未満の場合に true を返します。そうでない場合に false を返します。

//emlist[例][ruby]{
Rational(1, 2).negative? # => false
Rational(-1, 2).negative? # => true
//}

@see Rational#positive?