vbscript: Implemented Atn.
This commit is contained in:
parent
11755f76fd
commit
d7f4fa43eb
|
@ -661,10 +661,16 @@ static HRESULT Global_IsObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt,
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT Global_Ant(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
|
||||
static HRESULT Global_Atn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
|
||||
{
|
||||
FIXME("\n");
|
||||
return E_NOTIMPL;
|
||||
HRESULT hres;
|
||||
double d;
|
||||
|
||||
hres = to_double(arg, &d);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
return return_double(res, atan(d));
|
||||
}
|
||||
|
||||
static HRESULT Global_Cos(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
|
||||
|
@ -2027,7 +2033,7 @@ static const builtin_prop_t global_props[] = {
|
|||
{DISPID_GLOBAL_ISNUMERIC, Global_IsNumeric, 0, 1},
|
||||
{DISPID_GLOBAL_ISARRAY, Global_IsArray, 0, 1},
|
||||
{DISPID_GLOBAL_ISOBJECT, Global_IsObject, 0, 1},
|
||||
{DISPID_GLOBAL_ATN, Global_Ant, 0, 1},
|
||||
{DISPID_GLOBAL_ATN, Global_Atn, 0, 1},
|
||||
{DISPID_GLOBAL_COS, Global_Cos, 0, 1},
|
||||
{DISPID_GLOBAL_SIN, Global_Sin, 0, 1},
|
||||
{DISPID_GLOBAL_TAN, Global_Tan, 0, 1},
|
||||
|
|
|
@ -1166,4 +1166,26 @@ Call ok(Approch(Tan(True), -1.5574), "Tan(True) = " & Tan(True))
|
|||
Call ok(getVT(Tan(True)) = "VT_R8", "getVT(Tan(True)) = " & getVT(Tan(True)))
|
||||
Call ok(Approch(Tan(CByte(255)), 0.5872), "Tan(CByte(255)) = " & Tan(CByte(255)))
|
||||
Call ok(getVT(Tan(CByte(255))) = "VT_R8", "getVT(Tan(CByte(255))) = " & getVT(Tan(CByte(255))))
|
||||
|
||||
Call ok(Approch(Atn(Empty), 0), "Atn(Empty) = " & Atn(Empty))
|
||||
Call ok(getVT(Atn(Empty)) = "VT_R8", "getVT(Atn(Empty)) = " & getVT(Atn(Empty)))
|
||||
Call ok(Approch(Atn(Sqr(3) / 3), PI / 6), "Atn(Sqr(3) / 3) = " & Atn(Sqr(3) / 3))
|
||||
Call ok(getVT(Atn(Sqr(3) / 3)) = "VT_R8", "getVT(Atn(Sqr(3) / 3)) = " & getVT(Atn(Sqr(3) / 3)))
|
||||
Call ok(Approch(Atn(CCur(1)), PI / 4), "Atn(CCur(1)) = " & Atn(CCur(1)))
|
||||
Call ok(getVT(Atn(CCur(1))) = "VT_R8", "getVT(Atn(CCur(1))) = " & getVT(Atn(CCur(1))))
|
||||
Call ok(Approch(Atn(CSng(Sqr(3))), PI / 3), "Atn(CSng(Sqr(3))) = " & Atn(CSng(Sqr(3))))
|
||||
Call ok(getVT(Atn(CSng(Sqr(3)))) = "VT_R8", "getVT(Atn(CSng(PI))) = " & getVT(Atn(CSng(PI))))
|
||||
Call ok(Approch(Atn(0), 0), "Atn(0) = " & Atn(0))
|
||||
Call ok(getVT(Atn(0)) = "VT_R8", "getVT(Atn(0)) = " & getVT(Atn(0)))
|
||||
Call ok(Approch(Atn(-1), -PI / 4), "Atn(-1) = " & Atn(-1))
|
||||
Call ok(getVT(Atn(-1)) = "VT_R8", "getVT(Atn(-1)) = " & getVT(Atn(-1)))
|
||||
Call ok(Approch(Atn("-32768"), -1.5707), "Atn(""-32768"") = " & Atn("-32768"))
|
||||
Call ok(getVT(Atn("-32768")) = "VT_R8", "getVT(Atn(""-32768"")) = " & getVT(Atn("-32768")))
|
||||
Call ok(Approch(Atn(False), 0), "Atn(False) = " & Atn(False))
|
||||
Call ok(getVT(Atn(False)) = "VT_R8", "getVT(Atn(False)) = " & getVT(Atn(False)))
|
||||
Call ok(Approch(Atn(True), -0.7853), "Atn(True) = " & Atn(True))
|
||||
Call ok(getVT(Atn(True)) = "VT_R8", "getVT(Atn(True)) = " & getVT(Atn(True)))
|
||||
Call ok(Approch(Atn(CByte(255)), 1.5668), "Atn(CByte(255)) = " & Atn(CByte(255)))
|
||||
Call ok(getVT(Atn(CByte(255))) = "VT_R8", "getVT(Atn(CByte(255))) = " & getVT(Atn(CByte(255))))
|
||||
|
||||
Call reportSuccess()
|
||||
|
|
Loading…
Reference in New Issue