unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: guile-devel@gnu.org
Subject: Re: [PATCHES] Numeric improvements
Date: Thu, 07 Mar 2013 20:02:27 +0100	[thread overview]
Message-ID: <87ip53kp8c.fsf@gnu.org> (raw)
In-Reply-To: <87k3pk9sp7.fsf@tines.lan> (Mark H. Weaver's message of "Wed, 06 Mar 2013 15:30:44 -0500")

Mark H Weaver <mhw@netris.org> skribis:

>> What was the rationale for ‘round-ash’?
>
> Well, we need it internally to efficiently convert large integers to
> floating-point with proper rounding (see the call to
> 'round_right_shift_exact_integer' in patch 5).  Given that, it seemed
> reasonable to export it to the user, since it's not possible to do that
> job efficiently with our current primitives.  However, I don't feel
> strongly about it.

OK, the rationale makes sense to me.

>> It seems to address to do two things differently from ‘ash’: it’s more
>> efficient, and it rounds when right-shifting.  The “more efficient” bit
>> is an implementation detail that should also benefit to ‘ash’ (as a user
>> I don’t want to have to choose between efficient and non-rounding.)
>
> No, 'round-ash' is not more efficient than 'ash'.  It's more efficient
> than the equivalent (round (* n (expt 2 count))).

I see.  I misunderstood the documentation’s reference to efficiency.

Thanks,
Ludo’.



  reply	other threads:[~2013-03-07 19:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05 11:04 [PATCHES] Numeric improvements Mark H Weaver
2013-03-06 14:05 ` Ludovic Courtès
2013-03-06 20:30   ` Mark H Weaver
2013-03-07 19:02     ` Ludovic Courtès [this message]
2013-03-07  0:16   ` Mark H Weaver
2013-03-07  6:03     ` Mark H Weaver
2013-03-12 20:58       ` Mark H Weaver
2013-03-17 23:49 ` Mark H Weaver

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=87ip53kp8c.fsf@gnu.org \
    --to=ludo@gnu.org \
    --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).