caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Int64 overflow checks
Date: Tue, 1 May 2007 03:45:11 +0100	[thread overview]
Message-ID: <200705010345.11909.jon@ffconsultancy.com> (raw)
In-Reply-To: <A6FA37DD-F163-4B0C-99E5-4BBED31CD56A@rice.edu>

On Monday 30 April 2007 18:24, Raj B wrote:
> Hi
>
> I am writing an implementation of the Python programming language in
> OCaml and ran into an interesting issue.
>
> Python allows the programmer to implicitly perform arbitrary-sized
> integer operations by switching internally between its 'int' and
> 'long' types. (which seems to translate to OCaml's int64 and BigInt).
>
> I found an OCaml library on a mailing list which checks for overflow
> in 'normal' 32-bit integer operations. How can I check for overflows
> in int64 operations so I can switch to big-int if that happens?

Sounds like a premature optimization. Just use Big_int for everything to start 
with...

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The F#.NET Journal
http://www.ffconsultancy.com/products/fsharp_journal/?e


      parent reply	other threads:[~2007-05-01  2:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-30 17:24 Raj B
2007-05-01  2:41 ` [Caml-list] " skaller
2007-05-01  2:45 ` Jon Harrop [this message]

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=200705010345.11909.jon@ffconsultancy.com \
    --to=jon@ffconsultancy.com \
    --cc=caml-list@yquem.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;
as well as URLs for NNTP newsgroup(s).