src/stdlib/SDL_stdlib.c
changeset 8543 b9dd3cf38585
parent 8478 337b5dc0797b
parent 8033 8181c3a4a055
child 8583 fb2933ca805f
     1.1 --- a/src/stdlib/SDL_stdlib.c	Thu Nov 28 21:15:05 2013 -0500
     1.2 +++ b/src/stdlib/SDL_stdlib.c	Thu Nov 28 22:09:21 2013 -0500
     1.3 @@ -52,7 +52,12 @@
     1.4  #ifdef HAVE_CEIL
     1.5      return ceil(x);
     1.6  #else
     1.7 -    return (double)(int)((x)+0.5);
     1.8 +    double integer = SDL_floor(x);
     1.9 +    double fraction = x - integer;
    1.10 +    if (fraction > 0.0) {
    1.11 +        integer += 1.0;
    1.12 +    }
    1.13 +    return integer;
    1.14  #endif /* HAVE_CEIL */
    1.15  }
    1.16