QB / QB64 Discussion Forum      Other Subforums, Links and Downloads

 Return to Index  

Ted, thanks for fixing my coding error >>>

November 13 2007 at 3:30 PM
Moneo  (no login)

Response to OK, explain this then


I lifted the code from a working program of mine, and didn't test it again because it was already working. "Famous last words." The variable names were different. Sorry.

In the Microsoft document
that you quoted from, there's a table further down with the heading of "Sample Data". In this table you will notice that the column for Asymmetric Arithmetic and the column for Symmetric Arithmetic demonstrate the same differences between Earthborn/your rounding functions and my rounding function. The differences are:
For -2.5, yours gives -2, and mine -3
For -1.5, yours gives -1, and mone -2
For 0.5, yours gives 0, and mine -1.

My algorithm performs Symmetric Arithmetic Rounding, and the SGN and ABS are absolutely necessary. I don't understand why you don't accept this. This Symmetric Arithmetic algorithm has been discussed over the last 5 years on several QB forums as well as on the MathForum.

From the results that I see for Earthborn and your algoritms, it seems like they are performing Asymmetric Arithmetic Rounding. Having never worked with this rounding method, I can't say for sure.

We still don't know if Earthborn was implementing Symmetric of Asymmetric Arithmetic Rounding. Testing shows that the results will be the same for both methods, except for negative numbers that end in .5. If he or Solitaire never tested with this combination of values, their tests would have been satisfactory for them.

Thanks for all the work and effort that you put into this issue.

You're probably right about the IDE, but, "you can't teach an old dog new tricks."

Regards..... Moneo

 Respond to this message   

 Copyright © 1999-2018 Network54. All rights reserved.   Terms of Use   Privacy Statement  

Newbies usually go to www.qbasic.com and click on The QBasic Forum
Forum regulars have their own ways, which include The QBasic Community Forums