Add ceil
This commit is contained in:
parent
46d4893036
commit
a6f96243e2
@ -14,11 +14,6 @@ double asin(double x) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double ceil(double x) {
|
||||
BAD;
|
||||
return 0.0; /* extract and convert? */
|
||||
}
|
||||
|
||||
double cosh(double x) {
|
||||
BAD;
|
||||
return 0.0;
|
||||
|
@ -10,6 +10,15 @@ double exp(double x) {
|
||||
return pow(2.71828182846, x);
|
||||
}
|
||||
|
||||
double ceil(double x) {
|
||||
int _x = x;
|
||||
if ((float)_x == x) return x;
|
||||
if (x < 0.0) {
|
||||
return (double)_x;
|
||||
}
|
||||
return (double)_x + 1;
|
||||
}
|
||||
|
||||
double floor(double x) {
|
||||
MATH;
|
||||
if (x > -1.0 && x < 1.0) {
|
||||
|
Loading…
Reference in New Issue
Block a user