34件ヒット
[1-34件を表示]
(0.023秒)
別のキーワード
検索結果
-
Float
# negative? -> bool (18135.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 (18135.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 (18129.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 (60.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...modulo | o o o - -
nan? | - - o - -
negative? | o - o o -
next | - o - - -......**d
if self > 0
self.quo(x).ceil * x
else
self.quo(x).floor * x
end
end
def rounddown(d=0)
x = 10**d
if self < 0
self.quo(x).ceil * x
else
self.quo(x).floor * x
end
end
def roundoff(d=0)
x = 10**d
if self < 0
(self.quo(x) -......0.5).ceil * x
else
(self.quo(x) + 0.5).floor * x
end
end
end
//}...