More rounding


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]

Posted by Juan Romero Jr. on March 22, 2001 at 18:07:52:

Unless someone knows of a better way to round integers from floats (instead of having them truncated) try to figure something with the modulus operator. This is how I solved that problem in an earlier post on rounding, for example:
if the number of records is 10, the dimension should be 10 * 1.25 = 12.5, so if you want to round, you would round to 13, but C++ truncates the 12.5 to 12. There is a way to around this to get your numbers to round...


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]