caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] overflow checks on `int` operations
@ 2019-07-10 20:36 Stefan Monnier
  2019-07-10 23:05 ` Glen Mével
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2019-07-10 20:36 UTC (permalink / raw)
  To: caml-list

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.


        Stefan


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


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

end of thread, other threads:[~2019-07-12 18:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10 20:36 [Caml-list] overflow checks on `int` operations Stefan Monnier
2019-07-10 23:05 ` Glen Mével
2019-07-11  6:44   ` Gabriel Scherer
2019-07-12 17:44     ` Stefan Monnier

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