ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: Nobuyoshi Nakada <nobu@ruby-lang.org>
To: ruby-core@ruby-lang.org
Subject: Re: patch bignums
Date: Fri, 22 Sep 2006 01:30:49 +0900	[thread overview]
Message-ID: <200609211630.k8LGUkRT012129@sharui.kanuma.tochigi.jp> (raw)
In-Reply-To: <20060921175456.GA8077@localhost@localdomain>

Hi,

At Thu, 21 Sep 2006 23:52:56 +0900,
Ondrej Bilka wrote in [ruby-core:08904]:
> Bugfix and implented bignum odd? and even? 

Thank you, commited.

> BTW. How do you debug ruby. At README.EXT is this missing. 
> I dont know easy way to inspect ruby objects inside gdb. I used printf+guessing what obj contain.
> But now its "obvious bug" free.

I use attached .gdbinit.


Still I don't have time to review the patch, just a nitpicking.

> --- bignum.c	4 Sep 2006 20:10:45 -0000	1.135
> +++ bignum.c	21 Sep 2006 14:46:25 -0000
> @@ -38,6 +38,13 @@
>  
>  #define BIGZEROP(x) (RBIGNUM(x)->len == 0 || (RBIGNUM(x)->len == 1 && BDIGITS(x)[0] == 0))
>  
> +VALUE rb_num_plus(VALUE x,VALUE y);
> +VALUE rb_num_minus(VALUE x,VALUE y);
> +VALUE rb_num_mul(VALUE x,VALUE y);
> +VALUE rb_num_sqr(VALUE x);
> +VALUE rb_num_pow(VALUE x,VALUE y);

Why are these in bignum.c?  It feels they are OK in numeric.c.
Also, I suspect this change makes Fixnum operations slower.

> +#define CSTR_TO_BIG_TRESHOLD 32

Is TRESHOLD a typo?

> -    len *= strlen(str)*sizeof(char);
> +	len=strlen(str);
> +	BDIGIT hbase;
> +	long charsperdig;
> +	charperdig(base,&hbase,&charsperdig);
> +	long si=len/charsperdig+1; 

Illegal in C90.

> +	if FIXNUM_P(x) 

Oops.

-- 
Nobu Nakada

  reply	other threads:[~2006-09-21 16:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-21 14:52 patch bignums Ondrej Bilka
2006-09-21 16:30 ` Nobuyoshi Nakada [this message]
2006-09-21 17:12   ` Berger, Daniel
2006-09-22  1:01     ` Yukihiro Matsumoto
2006-09-21 18:33   ` Sam Roberts
2006-09-22  0:22     ` Nobuyoshi Nakada
2006-09-22  9:05   ` Ondrej Bilka

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-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200609211630.k8LGUkRT012129@sharui.kanuma.tochigi.jp \
    --to=ruby-core@ruby-lang.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).