From: Ramakrishnan Muthukrishnan <vu3rdd@gmail.com>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: fix for expt bug
Date: Wed, 3 Nov 2010 23:55:00 +0530 [thread overview]
Message-ID: <AANLkTimdRn-e6KG2=_Xt7winKDRsaTfzDSox-9+OFuSQ@mail.gmail.com> (raw)
In-Reply-To: <AANLkTi=yKq=CkVmZQ_xELVC7H5cbAkmC1krhajzhGMg_@mail.gmail.com>
On Wed, Nov 3, 2010 at 11:23 PM, Ramakrishnan Muthukrishnan
<vu3rdd@gmail.com> wrote:
> On Wed, Nov 3, 2010 at 9:52 PM, Mark H Weaver <mhw@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 exponents.
>>
>> Within that case, if the exponent is an inexact integer, then we make it
>> exact and make the base inexact, and then call scm_integer_expt.
>
> Mark,
>
> Why do we need to convert the base to inexact? is there any problem if
> they are just as it is and we convert only the exponent to exact when
> they are exact?
scheme@(guile-user)> (integer-expt (exact->inexact 3/2) (inexact->exact 4.0))
$17 = 5.0625
scheme@(guile-user)> (integer-expt 3/2 (inexact->exact 4.0))
$18 = 81/16
scheme@(guile-user)> (integer-expt (exact->inexact 3/2) (inexact->exact 4.0))
$19 = 5.0625
We want an output representation in an inexact form. For that reason,
we would want to do exact to inexact conversion of base. Is that
correct?
Mark, I guess your patch solves the problem in a much more efficient way.
thanks
--
Ramakrishnan
next prev parent reply other threads:[~2010-11-03 18:25 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-31 18:12 fix for expt bug Ramakrishnan Muthukrishnan
2010-11-01 0:03 ` Mark H Weaver
2010-11-01 4:03 ` Ramakrishnan Muthukrishnan
2010-11-01 18:23 ` Ramakrishnan Muthukrishnan
2010-11-02 4:55 ` Mark H Weaver
2010-11-02 5:22 ` Ramakrishnan Muthukrishnan
2010-11-02 5:36 ` Ramakrishnan Muthukrishnan
2010-11-02 19:19 ` Mark H Weaver
2010-11-02 23:00 ` Ludovic Courtès
2010-11-03 2:10 ` Mark H Weaver
2010-11-03 9:41 ` Ramakrishnan Muthukrishnan
2010-11-03 15:32 ` Mark H Weaver
2010-11-03 16:41 ` Ramakrishnan Muthukrishnan
2010-11-03 16:22 ` Mark H Weaver
2010-11-03 17:53 ` Ramakrishnan Muthukrishnan
2010-11-03 18:25 ` Ramakrishnan Muthukrishnan [this message]
2010-11-03 23:27 ` Ludovic Courtès
2010-11-04 17:27 ` Mark H Weaver
2010-11-08 21:08 ` Ludovic Courtès
2010-11-20 21:49 ` Andy Wingo
2010-11-21 22:34 ` Ludovic Courtès
2010-11-05 2:18 ` [PATCH] Fix bugs in expt and integer-expt Mark H Weaver
2010-11-10 22:01 ` Ludovic Courtès
2011-01-20 22:47 ` Andy Wingo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTimdRn-e6KG2=_Xt7winKDRsaTfzDSox-9+OFuSQ@mail.gmail.com' \
--to=vu3rdd@gmail.com \
--cc=guile-devel@gnu.org \
--cc=mhw@netris.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).