From: Sebastien Furic <sebastien.furic@tni-valiosys.com>
To: Claude Marche <Claude.Marche@lri.fr>,
"caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] Num library
Date: Fri, 11 Oct 2002 18:14:56 +0200 [thread overview]
Message-ID: <3DA6F900.773571ED@tni-valiosys.com> (raw)
In-Reply-To: <15782.53485.872091.234807@mailhost.lri.fr>
Claude Marche wrote:
>
> I have no benchmark to produce, I just want to share my own experience:
> I have an application where integers fit 99% of the time in machine
> ints, but not always, and since I want to be sure that no overflow
> occurs, I use the Num library. Some time ago, I've tried to used mlgmp
> instead. On my own tests, that are not supposed to be exhaustive, mlgmp
> was much faster when computing on really large integers, but when
> integers are small, Num is much faster.
>
> So I recommend to use mlgmp instead of Num only if you have large
> integers most of the time. I tried also numerix, but it seems not
> maintained anymore. Also I must say I did not use rational numbers.
>
> As Jean-Christophe said, when using Nums you should take care not to
> use structural equality (Pervasives.(=)) since representation of them
> is not unique. So use Num.eq_num, Num.compare_num instead. Same issue,
> you should not use Pervasives.hash, but something of your own.
You must use Num.eq_num for another reason: Pervasives.( = ) fails at
runtime on bigints and rationals. I had to rewrite parts of what I
considered "generic" data structures when I have used them to store
objects referencing bignums.
Cheers,
Sebastien.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
next prev parent reply other threads:[~2002-10-11 16:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-10 8:42 Alain Frisch
2002-10-10 9:42 ` sebastien FURIC
2002-10-10 14:56 ` Yaron M. Minsky
2002-10-10 17:14 ` Pierre Weis
2002-10-10 18:53 ` Alain Frisch
2002-10-11 20:01 ` Pierre Weis
2002-10-10 19:45 ` Yaron M. Minsky
2002-10-10 17:08 ` Pierre Weis
2002-10-11 9:26 ` Sebastien Furic
2002-10-11 20:17 ` Pierre Weis
2002-10-11 10:22 ` Alessandro Baretta
2002-10-11 13:23 ` Claude Marche
2002-10-11 16:14 ` Sebastien Furic [this message]
2002-10-11 14:08 ` Jean-Christophe Filliatre
2002-10-11 18:35 ` "custom" operators in caml (was: Re: [Caml-list] Num library) Chris Hecker
2002-10-11 20:30 ` [Caml-list] Num library Pierre Weis
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3DA6F900.773571ED@tni-valiosys.com \
--to=sebastien.furic@tni-valiosys.com \
--cc=Claude.Marche@lri.fr \
--cc=caml-list@inria.fr \
/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