C#编写的windows计算器-源代码(39) res = tmp; num++; tmp = 0; txtShow.Text = res.ToString(); dot = NODOT; break; case "sqrt": //平方根运算 if(opt!=NULL) { calc(); }
//opt=SQRT; if (tmp > 0) //要求操作数大于0 { res = Math.Sqrt(tmp);