value range propagation for _bitwise_ OR

Adam D. Ruppe destructionator at gmail.com
Sat Apr 10 14:21:44 PDT 2010


On Sat, Apr 10, 2010 at 04:05:06PM -0500, Andrei Alexandrescu wrote:
> The minimum for unsigned numbers is very simple: min(mina, minb).

mina = 1
minb = 0

min(1, 0) == 0

But, 1|0 == 1

max(mina, minb) looks to work though. Consider that ORing can only set bits -
it can never take a one and spit out a zero. Therefore, x|y >= x && x|y >= y,
which only works on the max(mina, minb) function.


-- 
Adam D. Ruppe
http://arsdnet.net



More information about the Digitalmars-d mailing list