From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.lisp.guile.user Subject: Re: strange behaviour of (floor .) Date: Sun, 03 Jan 2010 17:17:55 +0100 Message-ID: <87skanf9ho.fsf@ambire.localdomain> References: <20091228170236.GA27921@shoikan.fritz.box> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1262536595 25680 80.91.229.12 (3 Jan 2010 16:36:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jan 2010 16:36:35 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jan 03 17:36:28 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NRTQa-0001HW-0b for guile-user@m.gmane.org; Sun, 03 Jan 2010 17:35:40 +0100 Original-Received: from localhost ([127.0.0.1]:36293 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRTBt-0006z6-RI for guile-user@m.gmane.org; Sun, 03 Jan 2010 11:20:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRTBr-0006z1-5z for guile-user@gnu.org; Sun, 03 Jan 2010 11:20:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRTBn-0006yN-6z for guile-user@gnu.org; Sun, 03 Jan 2010 11:20:25 -0500 Original-Received: from [199.232.76.173] (port=53557 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRTBn-0006yK-2C for guile-user@gnu.org; Sun, 03 Jan 2010 11:20:23 -0500 Original-Received: from smtp-out13.alice.it ([85.33.2.18]:3046) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRTBm-0000rO-Lt for guile-user@gnu.org; Sun, 03 Jan 2010 11:20:22 -0500 Original-Received: from FBCMMO03.fbc.local ([192.168.68.197]) by smtp-out13.alice.it with Microsoft SMTPSVC(6.0.3790.3959); Sun, 3 Jan 2010 17:20:19 +0100 Original-Received: from FBCMCL01B07.fbc.local ([192.168.171.45]) by FBCMMO03.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Sun, 3 Jan 2010 17:20:19 +0100 Original-Received: from ambire.localdomain ([79.16.70.101]) by FBCMCL01B07.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Sun, 3 Jan 2010 17:20:18 +0100 Original-Received: from ttn by ambire.localdomain with local (Exim 4.63) (envelope-from ) id 1NRT9P-0007yM-Ed for guile-user@gnu.org; Sun, 03 Jan 2010 17:17:55 +0100 In-Reply-To: <20091228170236.GA27921@shoikan.fritz.box> (guign@mails.selgrad.org's message of "Mon, 28 Dec 2009 18:02:36 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-OriginalArrivalTime: 03 Jan 2010 16:20:18.0885 (UTC) FILETIME=[A40B1750:01CA8C90] X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7592 Archived-At: () guign@mails.selgrad.org () Mon, 28 Dec 2009 18:02:36 +0100 Maybe someone can comment on this (define (cents f) (remainder (inexact->exact (truncate (* 100 f))) 100)) Here, `truncate' is preferred because (floor -12.34) => -13.0. Note, however, that usually it is better (less fiddly) to represent monetary values as integers. thi