unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* GMP code committed -- watch for bugs.
@ 2003-04-04 22:34 Rob Browning
  2003-04-05 12:24 ` Marius Vollmer
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Rob Browning @ 2003-04-04 22:34 UTC (permalink / raw)



I've just committed the code that switches us over to full-time
bignums using GMP.  I've tagged before and after with rlb-pre-gmp and
rlb-post-gmp.

(Marius: we'll need to finish switching to LGPL now.  I put a note in
 LICENSE for now.  I suppose we'll need to exchange COPYING for
 COPYING.LIB.  However if automake throws a fit and/or keeps putting
 COPYING back, we might just leave it.  LICENSE is the critical file.)

(Mikael: if you get a second, could you look at random.c and make sure
 you don't see any obvious mistakes.  One thing in particular -- could
 you look at the FIXME there -- if there's a chance that a random
 bignum could end up with enough leading zeroes to place it in fixnum
 territory, then we need to return scm_i_normbig (result), but I
 wanted to check with you first.  Returning a bignum with a value in
 fixnum range would violate an assumption made by other guile
 numerical code.)

There may well be bugs -- in addition to numbers.c, the other main
things to check (if you're motiviated) are random.c, socket.c, and
num2integral.c.  If/when you do find a bug, could you also try to add
a suitable test (if possible) to test-suite/tests/numbers.test or
similar so we don't regress in the future?

Overall the performance in my really simple tests on ~256-bit bignums
suggests this is code faster than the old code, but less space
efficient for smaller values.

To some extent the conversion in numbers.c has been fairly
straightforward.  There may still be places (i.e. perhaps have
integer-expt use mpz_pow or mpf_pow_ui when the types are right) where
special casing with GMP operations could help, but it'll probably take
some good benchmarking to know for sure.

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2003-05-10  0:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-04 22:34 GMP code committed -- watch for bugs Rob Browning
2003-04-05 12:24 ` Marius Vollmer
2003-04-05 21:51 ` Mikael Djurfeldt
2003-04-05 22:26   ` Rob Browning
2003-04-06  7:41     ` Mikael Djurfeldt
2003-04-06  9:16   ` Mikael Djurfeldt
2003-04-06 18:43     ` Rob Browning
2003-04-06 19:12       ` Mikael Djurfeldt
2003-04-06 20:09         ` Rob Browning
2003-04-06 20:25     ` Rob Browning
2003-04-06  9:23 ` Mikael Djurfeldt
2003-04-06 20:15   ` Rob Browning
2003-04-06 22:50 ` Kevin Ryde
2003-05-10  0:22   ` GMP code committed -- watch for bugs ... gcd n 0 Kevin Ryde
2003-04-23 22:40 ` GMP code committed -- watch for bugs Kevin Ryde

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).