1
Boas, After the tips of the users I decided to improve my C# code of the calculator. I think it’s simpler but I have a little problem in the square root because I try to do the math and the result always gives me 0.
private void btn_raiz_Click(object sender, RoutedEventArgs e)
{
resutado = Convert.ToSingle(Math.Sqrt(primeiro));
janela.Text = resutado.ToString();
}
Hi Chris, just looking at this code lacks a lot of information. What is the value of
primeiro
? Whereresultado
andjanela
were declared, who calls this event and when? Try to create a MVCE– Anthony Accioly
Related: http://answall.com/questions/136662/calcular-raiz-quadrada-em-c?rq=1
– user28595