[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fix for expt bug
From: |
Mark H Weaver |
Subject: |
Re: fix for expt bug |
Date: |
Wed, 03 Nov 2010 11:32:28 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
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 only for cases where n is an
> + integer.
> + */
I repeat: In the equation above, -x^n parses as -(x^n), but it should be
(-x)^n. Same problem with (-1^n). Exponentiation has higher precedence
than negation.
The equation above should be: (-x)^n = (-1)^n * x^n
Feel free to add more parentheses if you like, but the ones I have
included are essential and must not be removed.
Everything else looks good to me.
Thanks,
Mark
- Re: fix for expt bug, Ramakrishnan Muthukrishnan, 2010/11/01
- Re: fix for expt bug, Ramakrishnan Muthukrishnan, 2010/11/01
- Re: fix for expt bug, Mark H Weaver, 2010/11/02
- Re: fix for expt bug, Ramakrishnan Muthukrishnan, 2010/11/02
- Re: fix for expt bug, Ramakrishnan Muthukrishnan, 2010/11/02
- Re: fix for expt bug, Mark H Weaver, 2010/11/02
- Re: fix for expt bug, Ludovic Courtès, 2010/11/02
- Re: fix for expt bug, Mark H Weaver, 2010/11/02
- Re: fix for expt bug, Ramakrishnan Muthukrishnan, 2010/11/03
- Re: fix for expt bug,
Mark H Weaver <=
- Re: fix for expt bug, Ramakrishnan Muthukrishnan, 2010/11/03
- Re: fix for expt bug, Mark H Weaver, 2010/11/03
- Re: fix for expt bug, Ramakrishnan Muthukrishnan, 2010/11/03
- Re: fix for expt bug, Ramakrishnan Muthukrishnan, 2010/11/03
- Re: fix for expt bug, Ludovic Courtès, 2010/11/03
- Re: fix for expt bug, Mark H Weaver, 2010/11/04
- Re: fix for expt bug, Ludovic Courtès, 2010/11/08
- Re: fix for expt bug, Andy Wingo, 2010/11/20
- Re: fix for expt bug, Ludovic Courtès, 2010/11/21
- [PATCH] Fix bugs in expt and integer-expt, Mark H Weaver, 2010/11/04