[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Bug in the numbers egg?
From: |
Zbigniew |
Subject: |
Re: [Chicken-users] Bug in the numbers egg? |
Date: |
Thu, 11 Aug 2005 13:39:21 -0500 |
Works for me. In fact (expt 100 10000) gives the wrong magnitude,
about 10^305, without the patch. Interestingly it is even faster than
"calc", the "C-style arbitrary precision calculator (version
2.11.10.1)":
time csi -batch -eval '(use numbers) (display (expt 100 10000))
(newline)' > /dev/null
real 0m0.093s user 0m0.049s sys 0m0.019s
time calc '100^10000' > /dev/null
real 0m0.172s user 0m0.078s sys 0m0.011s
On 8/10/05, Alex Shinn <address@hidden> wrote:
> At Wed, 10 Aug 2005 20:37:21 -0500, Alex Shinn wrote:
> >
> > (define (power base e) ; like expt but e must be an integer
>
> Might as well go all the way. Attached is a patch to numbers-base.scm
> which modifies the above power function to work on any real numbers
> and defines the default expt case in terms of that. It's not the
> fastest implementation but it's probably better to be correct first
> then optimize later.
>
> --
> Alex
>
>
>
> _______________________________________________
> Chicken-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/chicken-users
>
>
>
>