Integer arithmetic, multiplication overflow



Hi,

I trying to solve the following thing:
Having two finite precision unsigned integer numbers A and B,
and knowing that maximal represented number is X,
calculate A*B - X, in case of A*B overflow. Use only
basic algebraic operations.

Any hints welcome.
Thanks,

Tomek

.



Relevant Pages

  • Re: effective Method to calculate n-th power
    ... >> which, knowing the order, can be 'simplified'. ... > order of g^x alone?? ... > Do you now see that we are given insufficient information? ... Prev by Date: ...
    (sci.math)
  • Re: error in a form
    ... isn't valid - e.g. storing text into a numeric field. ... Without knowing more about the form, it's impossible to tell any more ... Prev by Date: ...
    (microsoft.public.access.forms)
  • What does this mean?
    ... get this message and I dont like things to happen without knowing what ... TIA, ... John ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: drop down box?
    ... Option Group may be better for the user; if you have 2000 or more, ... combo box may be too inconvenient for the user). ... It's a bit hard to advise without knowing a bit more about your ... Prev by Date: ...
    (microsoft.public.access.tablesdbdesign)
  • Re: interesting conversation
    ... I don't know if I can accept knowing that. ... You are an idiot. ... Prev by Date: ...
    (rec.sport.football.college)