120件ヒット
[101-120件を表示]
(0.083秒)
種類
- インスタンスメソッド (87)
- クラス (22)
- 特異メソッド (11)
ライブラリ
- ビルトイン (76)
-
json
/ add / exception (11) - prime (33)
クラス
- Exception (11)
- Integer (32)
- Prime (22)
- Rational (22)
- TracePoint (11)
キーワード
-
/ (21) - TracePoint (11)
- div (11)
-
prime
_ division (33) - quo (11)
-
raised
_ exception (11) -
to
_ json (11)
検索結果
-
Rational
# quo(other) -> Rational | Float (3112.0) -
商を計算します。
...//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 ZeroDivisionError other が 0 の時に発生します。
@see Numeric#quo... -
Exception
# to _ json(*args) -> String (3106.0) -
自身を JSON 形式の文字列に変換して返します。
...ds::Hash#to_json に渡されます。
//emlist[例][ruby]{
require "json/add/core"
begin
0/0
rescue => e
e.to_json # => "{\"json_class\":\"ZeroDivisionError\",\"m\":\"divided by 0\",\"b\":[\"/path/to/test.rb:4:in `/'\",\"/path/to/test.rb:4:in `<main>'\"]}"
end
//}
@see JSON::Generator::Gener...