On Feb 1, 3:13 am, [EMAIL PROTECTED] wrote:
> Its not an homework. I appeared for EA sports interview last month. I
> was asked this question and I got it wrong. I have already fidlled
> around with the answer but I don't know the correct reasoning behind
> it.

In that case, observer that a/b == a * (1/b), and if b is constant you
can compute (1/b) in advance.  Since the problem was set by game
programmers I'd hazard that they are OK with relatively limited
precision and the answer that they were looking for was:
    a = (b * 04444444445L) >> 32
Note that the constant there is in octal.

    Nicko

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to