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 B4E2317C453F for ; Mon, 31 Oct 2011 22:05:27 +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 20AFDEA69FB for ; Mon, 31 Oct 2011 21:55:17 +0900 (JST) Received: from localhost (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 053CC8FC26 for ; Mon, 31 Oct 2011 21:55:18 +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 nPD0UyHFgVOe for ; Mon, 31 Oct 2011 21:55:17 +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 D88A68FC22 for ; Mon, 31 Oct 2011 21:55:17 +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 2E60D952421 for ; Mon, 31 Oct 2011 21:55:13 +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 B85A33C229445; Mon, 31 Oct 2011 21:55:12 +0900 (JST) Received: from fluorine.ruby-lang.org (www.rubyist.net [210.251.121.216]) by carbon.ruby-lang.org (Postfix) with ESMTP id B32993C21EB93 for ; Mon, 31 Oct 2011 21:55:07 +0900 (JST) Received: from ruby-lang.org (localhost [127.0.0.1]) by fluorine.ruby-lang.org (Postfix) with ESMTP id 9EC5D251AD for ; Mon, 31 Oct 2011 21:55:07 +0900 (JST) Delivered-To: ruby-core@ruby-lang.org Date: Mon, 31 Oct 2011 21:55:07 +0900 Posted: Mon, 31 Oct 2011 21:55:07 +0900 From: Yusuke Endoh Reply-To: ruby-core@ruby-lang.org Subject: [ruby-core:40556] [ruby-trunk - Feature #5321] Introducing Numeric#exact? and Numeric#inexact? To: ruby-core@ruby-lang.org Message-Id: References: X-ML-Name: ruby-core X-Mail-Count: 40556 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: 10067 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. Hello, 2011/9/14 Kenta Murata : > 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. Can you show any actual use case? -- 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