I forget
I forget - what is the procedure for using 65535 to improve the resolution you get with the· */ operator?
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Comments
You can use ** instead of */ to improve the resolution, because the implied denominator is one part in 65536 instead of one part in 256. Say you want to multiply a variable x times 3.141593.
Using */ you would use y = x */ 804, because 804/256 is the closest approximation with that denominator of 2^8. Suppose x=10000. Then
y = x */ 804
will equal 31406, which is 10 less than the most correct answer, which is 31416. You could use
y = x */ 805.
which equals 31445, 29 units too high.
With ** instead, you would use, y = (x * 3) + (x ** 9280). That is because 9280/65536 is the closest approximation to 0.141593 with the 2^16 denominator. Again with x=10000,
y = (x * 3) + (x ** 9280)
comes out to 31416, as desired. It will be at most one unit off of the correct answer due to roundoff.
Sid, does that answer your question?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
will give y=497 when x = 2317.
Is that what you have?
Note that it could be better, as that calculation is losing significant figures. You could also do
and that would print out 497.0 and progress by units of 0.5 as x changes.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·