Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7441523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:01:43+00:00 2026-05-29T11:01:43+00:00

I am trying to divide two numbers, a numerator N by a divisor D.

  • 0

I am trying to divide two numbers, a numerator N by a divisor D.
I am using the Newton–Raphson method which uses Newton’s method to find the reciprocal of D (1/D). Then the result of the division can be found by multiplying the numerator N by the reciprocal 1/D to get N/D.

The Newton-Raphson algorithm can be found here

So the first step of the algorithm is to start with an initial guess for 1/D which we call X_0.

X_0 is defined as X_0 = 48/17-39/17*D

However, we must first apply a bit-shift to the divisor D to scale it so that 0.5 ≤ D ≤ 1. The same bit-shift should be applied to the numerator N so that the quotient does not change.

We then find X_(i+1) using the formula X_(i+1) = X_i*(2-D*X_i)

Since both the numerator N, divisor D, and result are all floating point IEEE-754 32-bit format, I am wondering how to properly apply this scaling since my value for 1/D does not converge to a value, it just approaches -Inf or +Inf (depending on D).

What I have found works though is that if I make X_0 less than 1/D, the algorithm seems to always converge. So if I just use a lookup table where I always store a bunch of values of 1/D and I can always ensure I have a stored 1/D value where D > Dmin, then I should be okay. But is that standard practice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:01:45+00:00Added an answer on May 29, 2026 at 11:01 am
    1. To set the sign bit correctly, perform the XOR on the sign of the original dividend and divisor.

    2. Make the sign of the divisor and dividend positive now.

    3. First set the dividend exponent equal to dividend_exponent- 1 – divisor_exponent – 1 + 127.
      The +127 is for the bias since we just subtracted it out. This scales the dividend by the same amount we will scale the divisor by.

    4. Change the divisor exponent to 126 (biased) or -1 (unbiased). This scales the divisor to between 0.5 and 1.

    5. Proceed to find Xo with the new scaled D value from step one. Xo = 48/17-32/17 * D.

    6. Proceed to find Xn using the new D until we have iterated enough times so that we have the precision we need. X(i+1) = X(i) * (2-D*X(i)). Also, the number of steps S we need is S = ceil(log_2((P + 1)/log_2(17))). Where P is the number of binary places

    7. Multiply Xn * N = 1/D * N = N/D and your result should be correct.

    Update: This algorithm works correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an issue trying to divide two decimals and then display the result.
I'm trying divide two numbers in assembly. I'm working out of the Irvine assembly
I'm trying to divide two fields (where sometimes the divisor might be zero) with
Using ExtJs. I'm trying to design a main which is divided into three sub
I am trying to divide two variables in Jquery as follows: var image_width =
I am trying to divide a NSMutableDictionary into two NSMutableArrays on comparing one keyValue
Intro: I'm working on an image processing task trying to find two borders of
I'm trying to map two objects to each other using a ManyToMany association, but
I'm trying to divide two integers and multiply by 100 but it keeps giving
I'm trying to divide in assembly language I can't find a good example online

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.