Re: Modulus problem
- From: zacariaz@xxxxxxxxx
- Date: 16 Jan 2007 06:42:00 -0800
I am very gratefull for all your help, but i think maybe i havent
discribed my problem well enough.
Lets take a couple og examples.
The MUL (multiplier) is a mnemonic representation of a cpu instruction.
The speed of it depends more os less of the values you want to
multiply, that is because it cant really multiply, it just add number
over and over and over again as many times is needed. e.g.
2*4 is not a problem but
123456789*987654321 could very well be.
As for DIV (division) it works more or less simular only it subtract
values instead and also it is potential slower than multiplying as it
work alot with floating point values.
As i said earlies, i am dividing two integers,
fx. 999999999999 / 2
and if it were just an one time thing, it wouldnt be a problem, but i
am gonna do it millions of times, and that makes a very big difference.
So, my though was, "there must be another way"
With the 999999999999 / 2 i dont need to know anything about the
quotient reasult, e.g. 499999999999, and also i dont need to know that
the remainder equals .5, only thing i need to know about the remainder
is if it equals zero or not.
So far so good.
I would call this thing i want a modulus with an bolean output, but i
cant use regular division and i havent got a modulus instruction.
Also you are right in asuming that i am working with 32 bit inteeger,
but that is just for starters.
Thank you again.
.
- Follow-Ups:
- Re: Modulus problem
- From: Jyrki Lahtonen
- Re: Modulus problem
- From: Pubkeybreaker
- Re: Modulus problem
- References:
- Modulus problem
- From: zacariaz
- Re: Modulus problem
- From: Pubkeybreaker
- Modulus problem
- Prev by Date: Re: Mod 2011
- Next by Date: Re: algebra with splitting field.
- Previous by thread: Re: Modulus problem
- Next by thread: Re: Modulus problem
- Index(es):