value range propagation for _bitwise_ OR

Ali Çehreli acehreli at yahoo.com
Mon Apr 12 10:55:40 PDT 2010


Jérôme M. Berger wrote:

 >> Your function reports 0b_111 for these set of values:
 >>
 >>         min_a = 5;
 >>         max_a = 6;
 >>         min_b = 4;
 >>         max_b = 4;
 >>
 >> But the maximum value of a|b is 6.
 >>
 > 	Yes, like I said with my code, it is conservative. It will give the
 > optimal result for over 99% of the cases but give a slightly higher
 > value for the rest.

Now I see my problem: I took Andrei's puzzle literally. The implication 
of _compiler_implementation_ was too subtle for me.

That's the reason why none of my "correctly inaccurate" solutions has 
been posted to this thread. :)

Ali



More information about the Digitalmars-d mailing list