From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David De La Harpe Golden Newsgroups: gmane.emacs.devel Subject: Re: numeri Date: Sat, 29 Nov 2008 19:01:22 +0000 Message-ID: <49319182.7070400@harpegolden.net> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1227985315 10224 80.91.229.12 (29 Nov 2008 19:01:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Nov 2008 19:01:55 +0000 (UTC) Cc: handa@m17n.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 29 20:02:58 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L6V5k-0008G4-9t for ged-emacs-devel@m.gmane.org; Sat, 29 Nov 2008 20:02:56 +0100 Original-Received: from localhost ([127.0.0.1]:58428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6V4a-00032G-A6 for ged-emacs-devel@m.gmane.org; Sat, 29 Nov 2008 14:01:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L6V4W-00031w-3m for emacs-devel@gnu.org; Sat, 29 Nov 2008 14:01:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L6V4U-00031k-In for emacs-devel@gnu.org; Sat, 29 Nov 2008 14:01:39 -0500 Original-Received: from [199.232.76.173] (port=49677 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6V4U-00031h-GM for emacs-devel@gnu.org; Sat, 29 Nov 2008 14:01:38 -0500 Original-Received: from harpegolden.net ([65.99.215.13]:39843) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L6V4S-0003LG-2T; Sat, 29 Nov 2008 14:01:36 -0500 Original-Received: from [87.198.54.44] (87-198-54-44.ptr.magnet.ie [87.198.54.44]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "David De La Harpe Golden", Issuer "David De La Harpe Golden Personal CA rev 3" (verified OK)) by harpegolden.net (Postfix) with ESMTP id 7016681E2; Sat, 29 Nov 2008 19:01:28 +0000 (GMT) User-Agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:106313 Archived-At: Eli Zaretskii wrote: > > Actually, why not make the above return the number 4? The Unicode > Data File Format says that this property's value is ``an integer or > rational number''. We could even use 0.2 for characters such as > "VULGAR FRACTION ONE FIFTH". Isn't that better than `1/5'? > > Bear in mind that 1/5 (0.2) isn't actually exactly representable by binary floating point, bit like the way 1/3 (0.333(3 recurring)) can't be written properly in decimal, so try in emacs lisp: (format "%.20f" 0.2) I'd tend to hold off on allowing the vulgar fractions to map to numbers without the programmer to do a conversion step and "own" the associated potential information loss - at least until there is no loss: Emacs Lisp could one day get CL-like exact rational numbers I guess (though bignums would probably be a higher priority...)