PDA

View Full Version : re: rounding numbers



jdunn
November 15th, 2009, 04:18 PM
Regarding this thread which was recently closed by the admins:

http://ubuntuforums.org/showthread.php?t=1326648

I am in an algorithms course and my homework assignment was to create optimized binary search trees and output the tables of costs. I asked how to round numbers, which had nothing to do with "doing your homework assignment for you". I am learning C++ on my own and my C++ knowledge/experience is very limited. To those who replied to the original thread: thanks. I have a good C++ book "Thinking in C++" and I had already searched the web to find several different solutions, mostly from legacy C, that I was not satisfied with. The rounding problem was actually related to an error in my code, which I found and fixed.

dwhitney67
November 15th, 2009, 04:46 PM
A little word of advice; next time do not mention the word "homework" in your posts. Also, it is best to show what you have attempted, thus giving the impression that you have at least taken a stab at the solution.

Often times when someone posts a thread indicating that they must accomplish a task using some off-wall approach, it is obvious that the problem relates to homework. So beware, we are not fools here.

jdunn
November 15th, 2009, 05:17 PM
A little word of advice; next time do not mention the word "homework" in your posts. Also, it is best to show what you have attempted, thus giving the impression that you have at least taken a stab at the solution.

Often times when someone posts a thread indicating that they must accomplish a task using some off-wall approach, it is obvious that the problem relates to homework. So beware, we are not fools here.

I should have asked how to truncate the numbers. I just wanted the "floats" in shorter form so they could be read more easily in the cost tables.

dwhitney67
November 15th, 2009, 05:23 PM
I should have asked how to truncate the numbers. I just wanted the "floats" in shorter former so they could be read more easily in the cost tables.

Ironically, you did do just that (using different words) in your first post. I wasn't until your patience ran out that you blurted the "homework" word when you 'bumped' your post.