Sign in to follow this  

Multiplication and division question

This topic is 4749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If some known division problems can be converted into a number that can be used to multiply to get the same answer like (number / 2) is the same as (number * 0.5). Is there a math calucation to determin what number should be multiplied from a division number ?

Share this post


Link to post
Share on other sites
A * (1 / D)

Where you would normally go 1/d

You can precalculate 1/d, or let your compiler do that for you. (assuming an optimising compiler).

The reson why this works?
Fractions,

A = A/1 (fractional)

Fractional division = reciprical & fractional multiplication

You calculate the recipcial by doing 1/d, you then do the fractional multiplication by doing the *. (this works because they all have the same demoninator, 1)

From,
Nice coder

Share this post


Link to post
Share on other sites

This topic is 4749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this