In console, it's showing the value of Mathf.Sin(Mathf.PI) not equal to 0. Is there any other way to do so.
Why do you need exact zero? The reason it will show a very tiny value close to zero, is because PI is not exactly PI. It's only a floating point number very close to PI, which itself is an irrational number, that cannot be represented in the computer. There are some hoops to jump through if you want to create a custom sine function which gives you exactly zero at these values, but there's almost never a good reason to do so. Most systems will just work with the tiny value. You shouldn't be comparing against zero anyway, but in case you must: use Mathf.Approximately or Round your value to zero.
yeah, i know that. But what i needed was a function that can round off the value upto some decimals. Basically i was trying to rotate a camera about a free point with "Mouse X" value. So, i needed to calculate the value of ( rcos(theta), rsin(theta) ). And i found a function for that, System.Math.Round(float value, int decimal points).
The code was for rotating camera about a free point with "Mouse X" value, with the formula ( rcos(theta), rsin(theta) ). The value was around 10 to the power -8, but when multiplied by a magnitude 'r', it somehow shows a value of -2.(something) and that can't be neglected, because it has a significant effect on the position of the camera. So, what I needed was a function that can round off the value up to some decimals.