this is kind of a specific situation to a problem the problem is it supposed to produce 0 when numen/domin =1 domin output shows 6 but the result shows NaN
when numen = 4 and domin = sqrt of 4 to the power of 2 which leads to 4/4 it shows the right answer same with all positive integers like 9,16,25,36 but if i put 6 it gives NaN
if I put 7 it shows 1.490116E-08
if I put 8 it shows 2.107342E-08
i know can state
if(numen==domin) result = 0;
but i really want to know why this is not working properly
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ps
{
class Program
{
static void Main(string[] args)
{
double numen = 6;
double domin = Math.Pow(Math.Sqrt(6), 2);
Console.WriteLine(domin);
double result = Math.Acos(numen /(domin));
Console.WriteLine(result);
}
}
}