static int Bsincos(lua_State *L) /** sincos(x) */ { int n=luaL_optint(L,2,DIGITS); M_APM a=Bget(L,1); M_APM s=Bnew(L); M_APM c=Bnew(L); m_apm_sin_cos(s,c,n,a); return 2; }
void m_apm_tan(M_APM r, int places, M_APM a) { M_APM tmps, tmpc, tmp0; tmps = M_get_stack_var(); tmpc = M_get_stack_var(); tmp0 = M_get_stack_var(); m_apm_sin_cos(tmps, tmpc, (places + 4), a); /* tan(x) = sin(x) / cos(x) */ m_apm_divide(tmp0, (places + 4), tmps, tmpc); m_apm_round(r, places, tmp0); M_restore_stack(3); }
void m_apm_sin_cos_mt(M_APM sinv, M_APM cosv, int places, M_APM aa) { m_apm_enter(); m_apm_sin_cos(sinv,cosv,places,aa); m_apm_leave(); }