4件ヒット
[1-4件を表示]
(0.051秒)
別のキーワード
検索結果
先頭4件
-
ZeroDivisionError (132007.0)
-
整数に対して整数の 0 で除算を行ったときに発生します。
整数に対して整数の 0 で除算を行ったときに発生します。 -
TracePoint
# raised _ exception -> Exception (18625.0) -
発生した例外を返します。
発生した例外を返します。
@raise RuntimeError :raise イベントのためのイベントフックの外側で実行し
た場合に発生します。
//emlist[例][ruby]{
trace = TracePoint.new(:raise) do |tp|
tp.raised_exception # => #<ZeroDivisionError: divided by 0>
end
trace.enable
begin
0/0
rescue
end
//} -
Rational
# / (other) -> Rational | Float (9343.0) -
商を計算します。
商を計算します。
@param other 自身を割る数
other に Float を指定した場合は、計算結果を Float で返します。
//emlist[例][ruby]{
r = Rational(3, 4)
r / 2 # => (3/8)
r / 2.0 # => 0.375
r / 0.5 # => 1.5
r / Rational(1, 2) # => (3/2)
r / 0 # => ZeroDivisionError
//}
@raise ZeroD... -
Rational
# quo(other) -> Rational | Float (9343.0) -
商を計算します。
商を計算します。
@param other 自身を割る数
other に Float を指定した場合は、計算結果を Float で返します。
//emlist[例][ruby]{
r = Rational(3, 4)
r / 2 # => (3/8)
r / 2.0 # => 0.375
r / 0.5 # => 1.5
r / Rational(1, 2) # => (3/2)
r / 0 # => ZeroDivisionError
//}
@raise ZeroD...