From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: guign@mails.selgrad.org Newsgroups: gmane.lisp.guile.user Subject: strange behaviour of (floor .) Date: Mon, 28 Dec 2009 18:02:36 +0100 Message-ID: <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 1262020138 31120 80.91.229.12 (28 Dec 2009 17:08:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Dec 2009 17:08:58 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Dec 28 18:08:51 2009 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 1NPJ5N-0004ob-3U for guile-user@m.gmane.org; Mon, 28 Dec 2009 18:08:49 +0100 Original-Received: from localhost ([127.0.0.1]:50280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NPJ5L-0003jV-7J for guile-user@m.gmane.org; Mon, 28 Dec 2009 12:08:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NPIzZ-0007f9-Fn for guile-user@gnu.org; Mon, 28 Dec 2009 12:02:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NPIzU-0007dM-DU for guile-user@gnu.org; Mon, 28 Dec 2009 12:02:48 -0500 Original-Received: from [199.232.76.173] (port=34281 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NPIzU-0007dH-5E for guile-user@gnu.org; Mon, 28 Dec 2009 12:02:44 -0500 Original-Received: from smtprelay04.ispgateway.de ([80.67.31.32]:52357) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NPIzT-0005nH-KZ for guile-user@gnu.org; Mon, 28 Dec 2009 12:02:43 -0500 Original-Received: from [77.22.3.60] (helo=localhost) by smtprelay04.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1NPIzQ-0004d6-Ol; Mon, 28 Dec 2009 18:02:40 +0100 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Df-Sender: 778998 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:7586 Archived-At: Hej all :) I'm a little confused by the results of (floor .) in a simple computation to get the fractional part of a monetary value. Maybe someone can comment on this, as especially in the last test case below the results seem very strange to me... The starting point is: guile> (rationalize (floor (* (- 12.34 (floor 12.34)) 100)) .0) 33 The actual result shoud be 34. I tired the following simplifications: guile> (rationalize (floor (* (- 12.34 (floor 12.34)) 100)) .0) 33 guile> (floor (* (- 12.34 (floor 12.34)) 100)) 33.0 guile> (* (- 12.34 (floor 12.34)) 100) 34.0 And checked, if this might be some sort of expected behaviour: guile> (floor 34.0) 34.0 I'm using guile 1.8.5. Thanks, and have a nice time :) Kai