Issue #5514 has been reported by tadayoshi funaba. ---------------------------------------- Feature #5514: Numeric への quotient と quotrem の追加 http://redmine.ruby-lang.org/issues/5514 Author: tadayoshi funaba Status: Open Priority: Low Assignee: Category: Target version: 2.0 Ruby では余りを求めるために modulo (%) と remainder が提供されています が、modulo には対応する div があり、またその組み合わせである divmod も 存在しますが remainder にはありません。そこで対応する quotient と quotrem を追加することを提案します。
on 2011-10-30 09:28
on 2011-10-31 02:30
Issue #5514 has been updated by Yukihiro Matsumoto. 対称性とか一貫性とか以外にquotientとquoremがあると嬉しい局面っ てのは具体的に例示できますか? ---------------------------------------- Feature #5514: Numeric への quotient と quotrem の追加 http://redmine.ruby-lang.org/issues/5514 Author: tadayoshi funaba Status: Open Priority: Low Assignee: Category: Target version: 2.0 Ruby では余りを求めるために modulo (%) と remainder が提供されています が、modulo には対応する div があり、またその組み合わせである divmod も 存在しますが remainder にはありません。そこで対応する quotient と quotrem を追加することを提案します。
on 2011-10-31 13:34
Issue #5514 has been updated by tadayoshi funaba. 丸めの方向の問題なので、ruby の場合 floor、ceil、truncate、round がある ことから、4つのパターンが有り得ると思います。ruby の div-mod は、floor 系と考えればいいと思います。実際、Common Lisp の floor は ruby の div と divmod をも含んだ内容になっています。実際の利用のされかたからすると すべてが等価値でないので、あとは truncate 系の quotient と quotrem をだ けあったらいいと思います。 例として身近にある位取り法を見てみると、暦では外挿して1年の前を紀元前1 年 (零年) として表現したりしますが、その零には特別な意味がないわけです から、紀元前でも後でも1月の前の月は12月のという事になります。この場合は、 floor 系をつかう事になります。一方で、時差を考える場合は、零に向って丸 めるわけですから truncate 系が必要になります。 他の言語だと、smalltalk では、quo と rem があって、haskell では quot、 rem、quotRem、CL では truncate をつかう事ができます。 ---------------------------------------- Feature #5514: Numeric への quotient と quotrem の追加 http://redmine.ruby-lang.org/issues/5514 Author: tadayoshi funaba Status: Open Priority: Low Assignee: Category: Target version: 2.0 Ruby では余りを求めるために modulo (%) と remainder が提供されています が、modulo には対応する div があり、またその組み合わせである divmod も 存在しますが remainder にはありません。そこで対応する quotient と quotrem を追加することを提案します。
on 2013-02-26 01:50
Issue #5514 has been updated by ko1 (Koichi Sasada). Category set to core Assignee set to matz (Yukihiro Matsumoto) 宙ぶらりんになっているようなので、まつもとさんにアサインしておきます。 ご検討下さい。 ---------------------------------------- Feature #5514: Numeric への quotient と quotrem の追加 https://bugs.ruby-lang.org/issues/5514#change-37019 Author: tadf (tadayoshi funaba) Status: Open Priority: Low Assignee: matz (Yukihiro Matsumoto) Category: core Target version: Next Major Ruby では余りを求めるために modulo (%) と remainder が提供されています が、modulo には対応する div があり、またその組み合わせである divmod も 存在しますが remainder にはありません。そこで対応する quotient と quotrem を追加することを提案します。
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.