QUOTE(Musketball @ Aug 20 2009, 01:50 PM)

QUOTE(DaMOB @ Aug 19 2009, 09:55 AM)

QUOTE(Musketball @ Aug 19 2009, 10:59 AM)

yea, sorry for the confusion. I meant to say if decimal round up or down for whole number, preferably was up since I would want to cast an extra whole spell to heal my target.
I ended up using INT, and will test more later this afternoon.
Thanks guys.
Int works and is what we used 25 years ago before we had ceil and floor. In today's world int, for this purpose, is frowned upon so it is a bad habit to use.
So I will go and look up what ceil and floor do and how to use them together I guess. Anyone give me a helpful example or point me to a resource like a website, since I will not be at the machine with actools installed for while?
Ahem, Google? Ceil and Floor are in every high level language and are all the same.
ceil
<cmath>
double ceil ( double x );
Round up a value.
Returns the smallest integer that is greater or equal to x
Parameters.
x
Floating point value
Return Value.
Ceiling of x.
Example.
/* ceil example */
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
cout << "ceil of 2.3 is " << ceil(2.3) << "\n";
cout << "ceil of 3.8 is " << ceil(3.8) << "\n";
cout << "ceil of -2.3 is " << ceil(-2.3) << "\n";
cout << "ceil of -3.8 is " << ceil(-3.8) << "\n";
return 0;
}
Output:
ceil of 2.3 is 3.0
ceil of 3.8 is 4.0
ceil of -2.3 is -2.0
ceil of -3.8 is -3.0
floor
<cmath>
double floor ( double x );
Round down value.
Returns the largest integer that is less than or equal to x
Parameters.
x
Floating point value
Return Value.
Floor of x.
Example.
/* floor example */
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
cout << "floor of 2.3 is " << floor(2.3) << "\n";
cout << "floor of 3.8 is " << floor(3.8) << "\n";
cout << "floor of -2.3 is " << floor(-2.3) << "\n";
cout << "floor of -3.8 is " << floor(-3.8) << "\n";
return 0;
}
Output:
floor of 2.3 is 2.0
floor of 3.8 is 3.0
floor of -2.3 is -3.0
floor of -3.8 is -4.0