I'm writing a program, that draws horizontal stripes and blank spaces between them with the same height 44.
So I made an inequality
$({{y}\over{44}}) \mod {2} < {1} $
The problem is I'm not allowed to use the division in this programming language.
Could you, please, help me to get rid of this division to make it giving me the same result.
Thanks in advance.
UPD: Sorry, I wasn't precise, I'm not allowed to use use even modulo, so I had to change it to this.
${{y} \over {44}} - {{{y} \over {44}} \over {2}} * 2 < 1 $
And this trick is working, because I can divide numbers by only powers of two.
UPD2: I changed the inequality to
${y} \mod {88} < {44} $
and transformed it to my case without modulo
${y} - {{y} \over {88}} * 88 < 44 $
but there is still division by number, which is not power of 2.
0and480– Ali_run Dec 01 '15 at 15:15