Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Round numbers

Status
Not open for further replies.

XcoelhoX

Programmer
Jan 6, 2006
1
0
0
PT
Hi:
I'm using C, and I haven´t the function Round in my libraries; I need to round numbers with a precision; how can I do it?
 
> I need to round numbers with a precision
What do you mean?
Like 123.45678 rounded to say 5 digits would be 123.46 ?

Are you aware of the approximate nature of floating point numbers that even if you achieve a display of 123.46, the actual numerical representation may be 123.45999 or 123.46001

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top