caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Till Varoquaux <till.varoquaux@gmail.com>
To: Elnatan Reisner <elnatan@cs.umd.edu>
Cc: Caml Mailing List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Int64 comparison
Date: Tue, 17 Mar 2009 09:12:49 -0400	[thread overview]
Message-ID: <9d3ec8300903170612t7f611961r6ad1f66c01f062fe@mail.gmail.com> (raw)
In-Reply-To: <FC17C629-D605-46B3-9690-85A119E9B223@cs.umd.edu>

Taken from Int64.ml:

let compare (x: t) (y: t) = Pervasives.compare x y

compare seems to be there for functor applications (e.g. Set.Make
needs it). I would use standard comparison; it should be exactly the
same except it will be more legible and might be a tad faster.

Till


On Tue, Mar 17, 2009 at 8:51 AM, Elnatan Reisner <elnatan@cs.umd.edu> wrote:
> Do the polymorphic ordering functions -- (<), (>), etc. -- correspond to the
> numerical ordering for Int64s and Int32s? I assume so, but I didn't see this
> specified anywhere.
>
> If the answer is 'yes', is there a reason I should prefer
> Int64.compare n1 n2 < 0
> to
> n1 < n2
> ? If there's no specific reason the first is better (and I don't see why it
> would be), I definitely prefer the second.
> -Elnatan
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


  reply	other threads:[~2009-03-17 13:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17 12:51 Elnatan Reisner
2009-03-17 13:12 ` Till Varoquaux [this message]
2009-03-17 15:13 ` [Caml-list] " Jérémie Dimino

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=9d3ec8300903170612t7f611961r6ad1f66c01f062fe@mail.gmail.com \
    --to=till.varoquaux@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=elnatan@cs.umd.edu \
    /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 NNTP newsgroup(s).