~ubuntu-branches/ubuntu/lucid/webkit/lucid-updates

« back to all changes in this revision

Viewing changes to JavaScriptCore/runtime/MathObject.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-02-04 19:30:57 UTC
  • mfrom: (1.2.8 upstream) (4.3.9 sid)
  • Revision ID: james.westby@ubuntu.com-20100204193057-d3018lm1fipb0703
* New upstream release
* debian/copyright:
- Updated with changes since 1.1.19.

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
    double arg = args.at(0).toNumber(exec);
219
219
    if (signbit(arg) && arg >= -0.5)
220
220
         return jsNumber(exec, -0.0);
221
 
    return jsNumber(exec, floor(arg + 0.5));
 
221
    double integer = ceil(arg);
 
222
    return jsNumber(exec, integer - (integer - arg > 0.5));
222
223
}
223
224
 
224
225
JSValue JSC_HOST_CALL mathProtoFuncSin(ExecState* exec, JSObject*, JSValue, const ArgList& args)