From fe5785af096b514bb67e59a833e3bef9e622fc98 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 2 Apr 2009 19:55:30 +0200 Subject: [PATCH] jscript: Added Math_cos implementation. --- dlls/jscript/math.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/math.c b/dlls/jscript/math.c index fc1651c4f30..ac487d133b9 100644 --- a/dlls/jscript/math.c +++ b/dlls/jscript/math.c @@ -212,8 +212,22 @@ static HRESULT Math_ceil(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS * static HRESULT Math_cos(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + VARIANT v; + HRESULT hres; + + TRACE("\n"); + + if(!arg_cnt(dp)) { + if(retv) num_set_nan(retv); + return S_OK; + } + + hres = to_number(dispex->ctx, get_arg(dp, 0), ei, &v); + if(FAILED(hres)) + return hres; + + if(retv) num_set_val(retv, cos(num_val(&v))); + return S_OK; } static HRESULT Math_exp(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,