4件ヒット
[1-4件を表示]
(0.109秒)
検索結果
先頭4件
-
Float
# negative? -> bool (63661.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? -
OpenSSL
:: BN # negative? -> bool (63661.0) -
自身が負である場合に true を返します。Ruby 2.5, OpenSSL 2.1.0 から利用できます。
自身が負である場合に true を返します。Ruby 2.5, OpenSSL 2.1.0 から利用できます。
//emlist[][ruby]{
require 'openssl'
p 15.to_bn.negative? # => false
p 0.to_bn.negative? # => false
p (-5).to_bn.negative? # => true
//} -
Rational
# negative? -> bool (63643.0) -
self が 0 未満の場合に true を返します。そうでない場合に false を返します。
self が 0 未満の場合に true を返します。そうでない場合に false を返します。
//emlist[例][ruby]{
Rational(1, 2).negative? # => false
Rational(-1, 2).negative? # => true
//}
@see Rational#positive? -
Numeric
# negative? -> bool (54661.0) -
self が 0 未満の場合に true を返します。そうでない場合に false を返します。
self が 0 未満の場合に true を返します。そうでない場合に false を返します。
//emlist[例][ruby]{
-1.negative? # => true
0.negative? # => false
1.negative? # => false
//}
@see Numeric#positive?