示例#1
0
文件: lmapm.c 项目: ld-test/lmapm
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;
}
示例#2
0
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);
}
示例#3
0
文件: mapm_mt.c 项目: alyst/zorba
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();
}