From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 8365017C453F for ; Mon, 31 Oct 2011 21:23:29 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 61965EA69F6 for ; Mon, 31 Oct 2011 21:13:19 +0900 (JST) Received: from localhost (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 3A2528FC2B for ; Mon, 31 Oct 2011 21:13:20 +0900 (JST) X-Virus-Scanned: amavisd-new at funfun.nagaokaut.ac.jp Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by localhost (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wR3K3dCnQvBN for ; Mon, 31 Oct 2011 21:13:20 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 19DF48FC29 for ; Mon, 31 Oct 2011 21:13:20 +0900 (JST) Received: from carbon.ruby-lang.org (carbon.ruby-lang.org [221.186.184.68]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id A9C5E952423 for ; Mon, 31 Oct 2011 21:13:16 +0900 (JST) Received: from beryllium.ruby-lang.org (beryllium.ruby-lang.org [127.0.0.1]) by carbon.ruby-lang.org (Postfix) with ESMTP id A71B33C229417; Mon, 31 Oct 2011 21:13:15 +0900 (JST) Received: from fluorine.ruby-lang.org (www.rubyist.net [210.251.121.216]) by carbon.ruby-lang.org (Postfix) with ESMTP id CFEDD3C21E2F6 for ; Mon, 31 Oct 2011 21:13:10 +0900 (JST) Received: from ruby-lang.org (localhost [127.0.0.1]) by fluorine.ruby-lang.org (Postfix) with ESMTP id C1AF3251AD for ; Mon, 31 Oct 2011 21:13:10 +0900 (JST) Delivered-To: ruby-core@ruby-lang.org Date: Mon, 31 Oct 2011 21:13:10 +0900 Posted: Mon, 31 Oct 2011 21:13:10 +0900 From: Yusuke Endoh Reply-To: ruby-core@ruby-lang.org Subject: [ruby-core:40555] [ruby-trunk - Feature #5321][Assigned] Introducing Numeric#exact? and Numeric#inexact? To: ruby-core@ruby-lang.org Message-Id: References: X-ML-Name: ruby-core X-Mail-Count: 40555 X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only members can post) X-ML-Info: If you have a question, send e-mail with the body "help" (without quotes) to the address ruby-core-ctl@ruby-lang.org; help= X-Mailer: Redmine X-Spam-Checker-Version: SpamAssassin 3.1.7-deb3 (2006-10-05) on carbon.ruby-lang.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=7.0 tests=BAYES_50,CONTENT_TYPE_PRESENT, FORGED_RCVD_HELO,X_MAILER_PRESENT autolearn=disabled version=3.1.7-deb3 X-Redmine-Issue-Author: mrkn X-Redmine-Issue-Assignee: matz X-Redmine-Issue-Id: 5321 X-Redmine-Mailinglistintegration-Message-Ids: 10062 X-Redmine-Project: ruby-trunk Auto-Submitted: auto-generated X-Redmine-Site: Ruby Issue Tracking System X-Redmine-Host: redmine.ruby-lang.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Precedence: bulk List-Id: ruby-core.ruby-lang.org List-Software: fml [fml 4.0.3 release (20011202/4.0.3)] List-Post: List-Owner: List-Help: List-Unsubscribe: Issue #5321 has been updated by Yusuke Endoh. Status changed from Rejected to Assigned Oops, sorry, I've closed this ticket by error. Reopen. -- Yusuke Endoh ---------------------------------------- Feature #5321: Introducing Numeric#exact? and Numeric#inexact? http://redmine.ruby-lang.org/issues/5321 Author: Kenta Murata Status: Assigned Priority: Normal Assignee: Yukihiro Matsumoto Category: Target version: Ruby has several numeric classes such as Integer. These classes are classified whether their instances represent numbers exactly. According to this, Integer and Rational are exact, and Float and BigDecimal are inexact because they're always including error. The exactness of a Complex depends on its real and imaginary parts. Now, Ruby's numeric classes doesn't provide predicators to investigate the exactness of their instances. So, if we want to examine whether a number is exactly zero, we must investigate the class of the number. I want simple way to examine the number exactness. I propose to introduce Numeric#exact? and/or Numeric#inexact? for resolving this inconvenience. -- http://redmine.ruby-lang.org