value range propagation for %

"Jérôme M. Berger" jeberger at free.fr
Sat Nov 27 11:03:42 PST 2010


Matthias Walter wrote:
> On 11/27/2010 12:54 PM, Ellery Newcomer wrote:
>> Hello.
>>
>> Today I've been thinking about calculating the range of values for
>>
>> x % y
>>
> You might want to state the problem more precisely. What exactly is a
> "range of values x % y" ? Do you look at the result for x,y in some
> sets? Or is either x or y fixed? From your example I would suppose that
> x shall be fixed and y goes through a range?!
> 
	The full problem may be stated as:

For all x such that: xl <= x <= xh
and for all y such that: yl <= y <= yh
define: z = x % y

Now, compute values zl and zh such that:
zl <= z <= zh
and there exists x and y such that z == zl
and there exists x and y such that z == zh

		Jerome
-- 
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101127/4f001366/attachment.pgp>


More information about the Digitalmars-d mailing list