Calculation - Optimization
I have some numbers in a ListBox:
I want to make calculations, for example adding
them, so i can get a result of no more than 600.
Example: 98,5 + 120,3.. = 501.3
98,5 + 120,3.. = 595,4
The sum that is close to 600 i want to
display it in a textbox
(or additem in another list).
Continue the calculations, without the
numbers allready used..
Find next value close to 600 ... etc
Anybody can help???
I'm not quite sure if I understand what you're driving at. If you are looking to, for example, add two numbers together and find the combination which comes closest to 600, you could order your list numerically in descending order. Move down the list until you reach a number <= 300. Add that number and the next one together and you'll have the result closest to 600.
On further thought, that won't work. I don't see any way to avoid adding each combination. If I think of anything I'll let you know. Sorry.
By leetcharmer in forum Java
Last Post: 05-22-2005, 09:31 PM
By meghalgandhi in forum .NET
Last Post: 04-29-2005, 08:02 AM
By Scott D. in forum Architecture and Design
Last Post: 05-23-2002, 02:04 PM
Last Post: 11-28-2001, 11:44 AM
By Robert in forum VB Classic
Last Post: 07-30-2001, 09:04 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL