From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mathieu Lirzin Newsgroups: gmane.lisp.guile.bugs Subject: bug#30953: =?UTF-8?Q?=E2=80=98min=E2=80=99?= and =?UTF-8?Q?=E2=80=98max=E2=80=99?= behavior when mixing exact and inexact numbers. Date: Mon, 26 Mar 2018 16:11:01 +0200 Message-ID: <87sh8nkjuy.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1522073422 7266 195.159.176.226 (26 Mar 2018 14:10:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Mar 2018 14:10:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) To: 30953@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Mar 26 16:10:18 2018 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0SpF-0001kM-TN for guile-bugs@m.gmane.org; Mon, 26 Mar 2018 16:10:18 +0200 Original-Received: from localhost ([::1]:56962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0SrH-0001Y8-D7 for guile-bugs@m.gmane.org; Mon, 26 Mar 2018 10:12:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0Sr0-0001ST-K5 for bug-guile@gnu.org; Mon, 26 Mar 2018 10:12:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0Sqw-0002rC-Nx for bug-guile@gnu.org; Mon, 26 Mar 2018 10:12:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46570) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0Sqw-0002qw-Jz for bug-guile@gnu.org; Mon, 26 Mar 2018 10:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f0Sqw-0007om-Ee for bug-guile@gnu.org; Mon, 26 Mar 2018 10:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mathieu Lirzin Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 26 Mar 2018 14:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30953 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.152207348730000 (code B ref -1); Mon, 26 Mar 2018 14:12:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Mar 2018 14:11:27 +0000 Original-Received: from localhost ([127.0.0.1]:54467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0SqN-0007no-GY for submit@debbugs.gnu.org; Mon, 26 Mar 2018 10:11:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0SqL-0007nZ-2R for submit@debbugs.gnu.org; Mon, 26 Mar 2018 10:11:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0SqC-0002NA-1k for submit@debbugs.gnu.org; Mon, 26 Mar 2018 10:11:19 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:45289) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f0SqB-0002N0-Mb for submit@debbugs.gnu.org; Mon, 26 Mar 2018 10:11:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0Sq5-0001Ja-WC for bug-guile@gnu.org; Mon, 26 Mar 2018 10:11:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0Sq0-0002G5-2Z for bug-guile@gnu.org; Mon, 26 Mar 2018 10:11:09 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43956) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0Spz-0002G0-VV for bug-guile@gnu.org; Mon, 26 Mar 2018 10:11:04 -0400 Original-Received: from [2a01:e35:2ec2:e580:7d5f:f616:fc6f:3970] (port=35610 helo=godel) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1f0Spz-0006lD-GR for bug-guile@gnu.org; Mon, 26 Mar 2018 10:11:03 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9036 Archived-At: Hello, I am observing a unexpected behavior of =E2=80=98min=E2=80=99 and =E2=80=98= max=E2=80=99: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> (min 1 2.4) $2 =3D 1.0 scheme@(guile-user)> (min 1/2 4.0) $7 =3D 0.5 scheme@(guile-user)> (max 4 3.5) $4 =3D 4.0 --8<---------------cut here---------------end--------------->8--- I would expect the results to be integers instead. AIUI the implementation of the =E2=80=98min=E2=80=99 procedure should to be equivale= nt to: (define (min val . rest) (let loop ((x val) (other rest)) (match other (() x) ((y . rest) (loop (if (< x y) x y) rest))))) Maybe there is a good performance reason for the current behavior. If that's the case then it should be specified in the manual that exact numbers are converted to real numbers when at least one of the arguments is inexact. Thanks. --=20 Mathieu Lirzin GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37