Login
Search
Welcome to the iTechForums.
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
To register now click here.
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 2
Members:
Number of Users Online:
Welcome to our newest member,
Reply
 
Thread Tools Display Modes
  #1  
Old 05-14-2008, 11:00 PM
Santa Claus Santa Claus is offline
Junior Member
 
Join Date: May 2008
Posts: 2
Default

Is this division algorithm fast?


If I have a division algorithm that resolves, on average, 3 base-10 decimal places every 5 tests (to resolve 3 digits requires anywhere from 1 to 10 tests), is that considered fast or slow, relative to other algorithms?

Is there a known method that resolves as fast as the Newton or Secant method?
Perhaps I'm misunderstanding you, but are you talking about the "keep subtracting till you hit zero" method? Doesn't that only work for ints? I'm doing operations on floats.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 05-14-2008, 11:30 PM
Hypersphere Man Hypersphere Man is offline
Junior Member
 
Join Date: May 2008
Posts: 1
Default

Dude are you trying to crack an RSA cipher???

I wrote a program about 100 years ago to try to do the same thing. If you start asking us for large prime numbers next, we're on to you! Ha..

This is great.

If you're trying to keep all the digits, try converting your numbers to binary and then using twos complement (XOR) to subtract. The bitwise operations are much faster than what the compiler will generate for you. Just remember to keep a counter. When the division yields a sign bit of 0, you're done. Depending on the accumulator logic, the other dividend is the count or count-1 depending on when you increment it.

Am I dating myself by talking Assembler? Probably, but what the heck. When I wrote something like this, it was for a Zilog Z80 processor (8 bit) running at 1 MHz so I really had no other option.

Good luck.

UPDATE: It will work with anything, you just need to employ the long division shift and keep track of the decimal point yourself. This is definitely only valid if you are willing to bypass the compiler and do the operations yourself. Do they even make assemblers any more? I honestly don't know, but if you can get to the actual CPU commands (mnemonics), your operations will go much faster.

Anyway, I guess that eliminates my assumption about RSA huh... I wish I could find my source, I'd send it to you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a better division algorithm? Santa Claus Software Design & Algorithms 0 05-14-2008 10:03 PM
Where Can I A Brand New Fast Desktop Computer With Windows Xp With It? (Websites HawaiiFishCave Windows XP 1 05-06-2008 10:34 PM
Division Algorithm? bulbuli Software Design & Algorithms 0 05-06-2008 06:17 PM
Small, Fast linux distro with Pidgin and Firefox included? glistam3 Linux 2 05-06-2008 05:25 PM
Why is the prim's algorithm greedy? Does the algorithm always return a correct peiyi l Software Design & Algorithms 1 05-06-2008 04:51 PM

Your Ad Here

All times are GMT. The time now is 01:05 PM.