caml-list - the Caml user's mailing list
 help / Atom feed
From: Stefan Monnier <>
Subject: [Caml-list] overflow checks on `int` operations
Date: Wed, 10 Jul 2019 16:36:01 -0400
Message-ID: <> (raw)

What's the "standard" way to perform arithmetic operations on `int` with
overflow checking (e.g. returning an `Option` or signaling an
exception on overflow)?

Currently I do the checks by hand but it occurred to me that maybe I'm
not the first one to want that.


PS: I'm not looking to have all arithmetic on `int` with overflow
checks: only some specific uses of them.

             reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 21:26 Stefan Monnier [this message]
2019-07-10 23:05 ` Glen Mével
2019-07-11  6:43   ` Gabriel Scherer
2019-07-12 18:58     ` Stefan Monnier

Reply instructions:

You may reply publically 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:

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

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror

AGPL code for this site: git clone public-inbox