is it possible

Status
Not open for further replies.

finst

New Member
i would like to do 8 bit division 2/5 and add quotient 0.4 with some integer value (for example 3) then result is 3.4.

what is the procedure for the above calculation. can anybody know algorithm or program?
plz send it to me immediately
 
finst said:
i would like to do 8 bit division 2/5 and add quotient 0.4 with some integer value (for example 3) then result is 3.4.

what is the procedure for the above calculation. can anybody know algorithm or program?
plz send it to me immediately

I'm not very sure what you're wanting?, you've already given what you need - calling the three values x, y, and z you need to calculate:

(x/y) + z

As it's a fixed calculation, do it in two stages, first divide x by y, then add z to the result.

You don't mention what language you are wanting to use, nor what system it's for - so anything else would only be speculation.
 
scale the division so you can work with integers. For example make it
20 / 5 wich is 4 then add 30 so the result will be 34. If you print the value on a display you can just add a decimal point beween the 3 and 4.

Pic's aren't very good at math, specially floating point.

For code snippets about multiplying and dividing go to the pic list
www.piclist.com
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…