mfc 计算器中sin ,log ,和ln函数怎么写在我的源程序上修改.有意的,我把源程序发过来.void CMy2008110139Dlg::OnBUTTONdaoshu() //求倒数运算{// TODO:Add your control notification handler code hereif(m_val=='0')if(m_val=='0')

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 01:50:15

mfc 计算器中sin ,log ,和ln函数怎么写在我的源程序上修改.有意的,我把源程序发过来.void CMy2008110139Dlg::OnBUTTONdaoshu() //求倒数运算{// TODO:Add your control notification handler code hereif(m_val=='0')if(m_val=='0')
mfc 计算器中sin ,log ,和ln函数怎么写
在我的源程序上修改.
有意的,我把源程序发过来.
void CMy2008110139Dlg::OnBUTTONdaoshu() //求倒数运算
{
// TODO:Add your control notification handler code hereif(m_val=='0')
if(m_val=='0')
{
m_val="除数不能为零";
UpdateData(false);
}
else
{
double c;
UpdateData();
a=atof(m_val);
c=1/a;
m_val.Format("%f",c);
UpdateData(false);
}
}
void CMy2008110139Dlg::OnBUTTONpingfang() //求平方运算
{
// TODO:Add your control notification handler code here
double c;
UpdateData();
a=atof(m_val);
c=a*a;
m_val.Format("%f",c);
UpdateData(false);
}
void CMy2008110139Dlg::OnBUTTONsin()
{
// TODO:Add your control notification handler code here
这里的代码怎么写?

mfc 计算器中sin ,log ,和ln函数怎么写在我的源程序上修改.有意的,我把源程序发过来.void CMy2008110139Dlg::OnBUTTONdaoshu() //求倒数运算{// TODO:Add your control notification handler code hereif(m_val=='0')if(m_val=='0')
double c;
UpdateData();
c=sin(a);
m_val.Format("%f",c);
UpdateData(false);
在头文件中添加"math.h"