comp.lang.ada
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
Subject: Re: Wraparound on multiply overflow
Date: Fri, 10 Aug 2001 10:25:02 +0200
Date: 2001-08-10T10:25:02+02:00	[thread overview]
Message-ID: <8766bw490h.fsf@deneb.enyo.de> (raw)
In-Reply-To: 3B71AC13.F67BDC2@cadence.com

Paul Graham <pgraham@cadence.com> writes:

> In C it is defined that the result of multiplying two unsigned integers
> is the mathematical result modulo the value (int_max + 1), where int_max
> is the maximum unsigned integer.

This is only true for unsigned types.

> Can this code be written in Ada?

Use a modular type.  They correspond to unsigned types in C.



  parent reply	other threads:[~2001-08-10  8:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-08 21:16 Wraparound on multiply overflow Paul Graham
2001-08-09 16:23 ` Jacob Sparre Andersen
2001-08-10  8:25 ` Florian Weimer [this message]
2001-08-16  5:17 ` David Thompson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox