| | |
round off number
![]() |
•
•
•
•
I'm with bumsfeld on this one. You want as much precision as you can get throughout the program's calculations and only round for the display. You don't even want to round the number itself, just the display.
If you round prematurely, all your calculations will be slightly off. And the more calculations you do, the more inaccurate your answer.
I don't accept change; I don't deserve to live.
•
•
•
•
It may be quite possible that the data rounded off is not used for calculations or used in calcultions which requires only the rounded off values. It could also be written to a file and used only for data analysis purposes, or maybe the OP had some other idea in his mind or maybe it was part of an assignment given at the college to test his coding skills, you never know.

So listen up, noobs! Post enough information that we don't have to guess at what you need to know. You need to tell us! That way us folks that are trying to help you pass your classes won't get into arguments like this one!
:p
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
lol.. :D I agree with you on that one, old buddies fighting over beginners is indeed not a good sight :)
I don't accept change; I don't deserve to live.
•
•
Join Date: Sep 2006
Posts: 26
Reputation:
Solved Threads: 0
•
•
•
•
lol..I agree with you on that one, old buddies fighting over beginners is indeed not a good sight
because i'll use the returned value for another function
C Syntax (Toggle Plain Text)
unsigned int CalculatePercentage(int TC,int PC){ return 100.0f*PC/TC; }
![]() |
Similar Threads
- VB 2005 Trigonometric Functions (VB.NET)
- seperate float's decimal portion (C)
- Computer Architecture Reference (Computer Science)
- Round Numbers (JavaScript / DHTML / AJAX)
- !!! Help ME !!!!! (Pascal and Delphi)
- floating point : overflow error (C)
- Creating simple array... headache. (Java)
Other Threads in the C Forum
- Previous Thread: Other loop than 'for'?
- Next Thread: Hi, would you mind helping me with my homework?
| Thread Tools | Search this Thread |
#include adobe ansi api array asterisks binarysearch changingto char character cm copyimagefile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax database directory dynamic execv feet fgets file fork forloop frequency function getlasterror givemetehcodez global grade graphics gtkgcurlcompiling hacking hardware highest histogram i/o include incrementoperators infiniteloop input interest kernel keyboard kilometer license linked linkedlist linux linuxsegmentationfault list locate logical_drives looping loopinsideloop. lowest match matrix meter microsoft motherboard mqqueue mysql number odf opensource owf pattern pdf performance pointer posix probleminc process program programming radix recursion recv repetition research reversing scanf segmentationfault sequential shape socket socketprograming standard string systemcall threads turboc unix user voidmain() wab windows.h windowsapi







I agree with you on that one, old buddies fighting over beginners is indeed not a good sight 