Re: Integer arithmetic, multiplication overflow
- From: Tomek <t.koziara@xxxxxxxxx>
- Date: Wed, 08 Jun 2005 21:27:51 +0100
On Wed, 08 Jun 2005 22:12:32 +0100, JEMebius wrote:
> If the result register of an integer multiplication instruction is twice
> as wide as the factor registers then overflow will never occur.
> ...
Yes, but lets try to detach it from this context.
For example in case of addition it's simple:
A+B > X => A+B overflows.
A+B - X = X - ((X-A) + (X-B)) - and all the terms can be
computed without overflow. form that point it is easy
to design general addition / subtraction algorithm
for any base, fixed precision arithmetic, and for example
having 32-bit integers build 2^32 based representation.
I am just trying to complete it with multiplication.
Shouldn't be that difficult I guess.
.
- Follow-Ups:
- Re: Integer arithmetic, multiplication overflow
- From: Timothy Little
- Re: Integer arithmetic, multiplication overflow
- From: Keith A. Lewis
- Re: Integer arithmetic, multiplication overflow
- References:
- Integer arithmetic, multiplication overflow
- From: Tomek
- Re: Integer arithmetic, multiplication overflow
- From: JEMebius
- Integer arithmetic, multiplication overflow
- Prev by Date: Re: Galois Theory Problem
- Next by Date: Re: prove this statement with math?
- Previous by thread: Re: Integer arithmetic, multiplication overflow
- Next by thread: Re: Integer arithmetic, multiplication overflow
- Index(es):
Relevant Pages
|