ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: Yusuke Endoh <mame@tsg.ne.jp>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:40563] Re: [ruby-trunk - Feature #5321] Introducing Numeric#exact? and Numeric#inexact?
Date: Mon, 31 Oct 2011 23:24:08 +0900	[thread overview]
Message-ID: <CAJeyfup6kTscp--MXciZJJGgFUpdQp=_QVWbHcm_dNXCA1MSOg@mail.gmail.com> (raw)
In-Reply-To: <redmine.journal-21710.20111031225500@ruby-lang.org>

Hello,

2011/10/31 Kenta Murata <muraken@gmail.com>:
> I want to create a mathematical function which behaves like 1/x.
> This function is defined over real numbers except for zero,
> because lim_{x -> +0} 1/x = +inf while lim_{x -> -0} 1/x = -inf.
> So I want to raise Math::DomainError for the function with exact zero.
> But I don't want to raise the error for inexact zeros, such as 0.0, -0.0,
> BigDecimal("0"), and others which are instances of classes I don't know.
>
> If Numeric#inexact? and Numeric#exact? are given,
> I can realize the function more easily.


Thank you for the explanation.

You expect that 1/x does never raise any exception if x is an
inexact number, right?  I wonder if the expectation is valid.

But anyway, your use case is certainly convincing for me.
Thank you.

-- 
Yusuke Endoh <mame@tsg.ne.jp>

  reply	other threads:[~2011-10-31 14:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-14  4:20 [ruby-core:39539] [Ruby 1.9 - Feature #5321][Open] Introducing Numeric#exact? and Numeric#inexact? Kenta Murata
2011-10-29 22:09 ` [ruby-core:40514] [ruby-trunk - Feature #5321] " Alexey Muranov
2011-10-29 23:57 ` [ruby-core:40519] " Charles Nutter
2011-10-30 12:29 ` [ruby-core:40524] " Alexey Muranov
2011-10-31 11:04   ` [ruby-core:40553] " Alex Young
2011-10-31 12:13 ` [ruby-core:40555] [ruby-trunk - Feature #5321][Assigned] " Yusuke Endoh
2011-10-31 12:55 ` [ruby-core:40556] [ruby-trunk - Feature #5321] " Yusuke Endoh
2011-10-31 13:21 ` [ruby-core:40557] " Alexey Muranov
2011-10-31 13:32 ` [ruby-core:40558] " Kenta Murata
2011-10-31 13:54 ` [ruby-core:40559] " tadayoshi funaba
2011-10-31 14:34   ` [ruby-core:40565] " Yusuke Endoh
2011-10-31 13:55 ` [ruby-core:40560] " Kenta Murata
2011-10-31 14:24   ` Yusuke Endoh [this message]
2011-10-31 14:13 ` [ruby-core:40561] " Alexey Muranov
2011-10-31 14:54 ` [ruby-core:40566] " Kenta Murata
2011-10-31 14:59 ` [ruby-core:40567] " tadayoshi funaba
2011-10-31 15:32 ` [ruby-core:40570] " Alexey Muranov
2011-11-01 12:14 ` [ruby-core:40622] [ruby-trunk - Feature #5321][Assigned] " Masaya Tarui
2012-11-20 11:55 ` [ruby-core:49681] [ruby-trunk - Feature #5321] " mame (Yusuke Endoh)
2019-08-01  1:02 ` [ruby-core:94087] [Ruby master Feature#5321] " merch-redmine
2020-01-04  6:27 ` [ruby-core:96652] " wishdev
2020-01-15  2:23 ` [ruby-core:96861] " akr
2020-01-15  2:43 ` [ruby-core:96863] " sawadatsuyoshi
2020-01-15  3:03 ` [ruby-core:96864] " akr
2020-01-15  6:19 ` [ruby-core:96868] " sawadatsuyoshi
2020-01-16  8:04 ` [ruby-core:96899] " matz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJeyfup6kTscp--MXciZJJGgFUpdQp=_QVWbHcm_dNXCA1MSOg@mail.gmail.com' \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).