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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rounding

Status
Not open for further replies.

peterworth

Programmer
Aug 18, 2004
80
GB
whats the easiest way to round a float down? (so that a double like 2.8 becomes an int value of 2)
 
will a cast always round down? i thought that would make x = 3
 
Remember double floor(double) - ANSI/ISO Standard Library function from <cmath> (former <math.h>). It's exactly round down for positive numbers...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top