Hi,
Andy Wingo wi...@pobox.com writes:
There is also Mike Sperber's paper a few years ago about Scheme's
numeric tower being borked.
Anyway, just to say that you're in good company :)
Heh, good to know, and interesting link!
Ludo’.
Hi,
On Mon 08 Nov 2010 22:08, l...@gnu.org (Ludovic Courtès) writes:
Mark H Weaver m...@netris.org writes:
No, (integer? 3.0) returns #t, as it should, according to R5RS.
R5RS's description of integer? gives this precise example, and
guile's implementation agrees.
Damn, I had never
Hi Mark!
Mark H Weaver m...@netris.org writes:
No, (integer? 3.0) returns #t, as it should, according to R5RS.
R5RS's description of integer? gives this precise example, and
guile's implementation agrees.
Damn, I had never realized that, shame on me.
Ludo’.
l...@gnu.org (Ludovic Courtès) writes:
I just realized that there is a better way to fix these bugs. We don't
need a new top-level case in expt after all. Instead, we generalize the
scm_integer_expt case to support inexact integer exponents.
You mean “inexact number”, right?
No, I meant
Thanks again, Mark and Ludovic.
Attached is an updated patch.
thanks
--
Ramakrishnan
From a1dd2da8562ddeb2052f2994ad0302bcc8d5d1a2 Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan vu3...@gmail.com
Date: Sun, 31 Oct 2010 23:22:52 +0530
Subject: [PATCH] Adding a case for `expt' when
Hi Ramakrishnan,
We're almost there, but you neglected one of the comments I made about
your previous patch.
+ /* If base is negative, expt needs to find -x^n = (-1^n) * (x^n).
+ We find x^n and then if n is odd, we also multiply the result
+ with -1. These changes apply
Ramakrishnan and others,
I just realized that there is a better way to fix these bugs. We don't
need a new top-level case in expt after all. Instead, we generalize the
scm_integer_expt case to support inexact integer exponents.
Within that case, if the exponent is an inexact integer, then we
On Wed, Nov 3, 2010 at 9:02 PM, Mark H Weaver m...@netris.org wrote:
Hi Ramakrishnan,
We're almost there, but you neglected one of the comments I made about
your previous patch.
Sorry, I should pay more attention. :-(
Attaching the modified patch.
--
Ramakrishnan
From
On Wed, Nov 3, 2010 at 9:52 PM, Mark H Weaver m...@netris.org wrote:
Ramakrishnan and others,
I just realized that there is a better way to fix these bugs. We don't
need a new top-level case in expt after all. Instead, we generalize the
scm_integer_expt case to support inexact integer
On Wed, Nov 3, 2010 at 11:23 PM, Ramakrishnan Muthukrishnan
vu3...@gmail.com wrote:
On Wed, Nov 3, 2010 at 9:52 PM, Mark H Weaver m...@netris.org wrote:
Ramakrishnan and others,
I just realized that there is a better way to fix these bugs. We don't
need a new top-level case in expt after
Hi Mark,
Mark H Weaver m...@netris.org writes:
I just realized that there is a better way to fix these bugs. We don't
need a new top-level case in expt after all. Instead, we generalize the
scm_integer_expt case to support inexact integer exponents.
You mean “inexact number”, right?
The
Hi Ramakrishnan,
The code in your latest patch looks good to me, though the commit
message has some problems, and I'd add more test cases:
* libguile/numbers.c: If base is negative, expt needs to find
-x^n = (-1^n) * (|x|^n). We find x^n and then if n is odd, we
also multiply the result
Hi Ramakrishnan,
I noticed one more problem with your commit message. It should mention
the other included bug fix, for when the exponent is an inexact integer,
e.g. (expt 2 2.0).
Thanks,
Mark
. The patch fixes this too.)
Also adds some test cases. Please review.
Thanks
Ramakrishnan
From 025bde78d4c199dee1d2857e913d69ce4d7c2e59 Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan vu3...@gmail.com
Date: Sun, 31 Oct 2010 23:22:52 +0530
Subject: [PATCH] Fix for bug #31464. expt needs
Hi Ramakrishnan,
Thanks for the revised patch. There are still some problems:
diff --git a/libguile/numbers.c b/libguile/numbers.c
index fbc6cc8..5bbf4b0 100644
--- a/libguile/numbers.c
+++ b/libguile/numbers.c
@@ -5445,12 +5445,30 @@ SCM_DEFINE (scm_expt, expt, 2, 0, 0,
Return
Here is the updated patch.
thanks
Ramakrishnan
From e320d79c8f3cd8b7ddcb9c2d13356e34a3346cfe Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan vu3...@gmail.com
Date: Sun, 31 Oct 2010 23:22:52 +0530
Subject: [PATCH] Fix for bug #31464. expt needs to treat negative bases specially
2001
From: Ramakrishnan Muthukrishnan vu3...@gmail.com
Date: Sun, 31 Oct 2010 23:22:52 +0530
Subject: [PATCH] Fix for bug #31464. expt needs to treat negative bases specially.
Also adding test-suite cases for expt.
* libguile/numbers.c: if base is negative, find the absolute value
of the base
it.
thanks
--
Ramakrishnan
From c23939a1c2b7bfe1b3cf20abb6a7b431699281a1 Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan vu3...@gmail.com
Date: Sun, 31 Oct 2010 23:22:52 +0530
Subject: [PATCH] Fix for bug #31464. expt needs to treat negative bases
specially.
Also adding test
On Mon, Nov 1, 2010 at 5:33 AM, Mark H Weaver m...@netris.org wrote:
Ramakrishnan,
Your fix is incorrect. You have assumed that (-a)^b = -(a^b),
Mark,
Yes, you are right. Not sure what I was thinking when I made the patch. :-(
The reported bug is simply due to roundoff error. You must
19 matches
Mail list logo